package cygx

import "github.com/beego/beego/v2/client/orm"

type CygxAskserieVideoHistoryRecordResp struct {
	Id               int    `orm:"column(id);pk"`
	AskserieVideoId  int    `description:"askserie_video_id"`
	UserId           int    `description:"用户ID"`
	CreateTime       string `description:"创建时间"`
	Mobile           string `description:"手机号"`
	Email            string `description:"邮箱"`
	CompanyId        int    `description:"公司id"`
	CompanyName      string `description:"公司名称"`
	RealName         string `description:"用户实际名称"`
	SellerName       string `description:"所属销售"`
	RegisterPlatform string `description:"来源 1小程序，2：网页"`
	ModifyTime       string `description:"更新时间"`
	VideoDuration    string `description:"视频时长"`
	PlaySeconds      string `description:"播放时间 单位s"`
}

type AskserieVideoIdIdReq struct {
	AskserieVideoId int `description:"ID"`
}

// Pv数据列表
type CygxCygxAskserieVideoHistoryRecordListResp struct {
	//Paging *paging.PagingItem `description:"分页数据"`
	List []*CygxAskserieVideoHistoryRecordResp
}

// 列表
func GetCygxAskserieVideoHistoryRecordList(condition string, pars []interface{}) (items []*CygxAskserieVideoHistoryRecordResp, err error) {
	o := orm.NewOrmUsingDB("hz_cygx")
	sql := `SELECT * FROM cygx_askserie_video_history_record as art WHERE 1= 1 `
	if condition != "" {
		sql += condition
	}
	_, err = o.Raw(sql, pars).QueryRows(&items)
	return
}

type CygxAskserieVideoCollectionResp struct {
	Id               int    `orm:"column(id);pk"`
	AskserieVideoId  int    `description:"askserie_video_id"`
	UserId           int    `description:"用户ID"`
	CreateTime       string `description:"创建时间"`
	Mobile           string `description:"手机号"`
	Email            string `description:"邮箱"`
	CompanyId        int    `description:"公司id"`
	CompanyName      string `description:"公司名称"`
	RealName         string `description:"用户实际名称"`
	SellerName       string `description:"所属销售"`
	RegisterPlatform string `description:"来源 1小程序，2：网页"`
	ModifyTime       string `description:"更新时间"`
	Content          string `description:"留言"`
}

// Pv数据列表
type CygxAskserieVideoCollectionListResp struct {
	//Paging *paging.PagingItem `description:"分页数据"`
	List []*CygxAskserieVideoCollectionResp
}

// 列表
func GetCygxAskserieVideoCollectionList(condition string, pars []interface{}) (items []*CygxAskserieVideoCollectionResp, err error) {
	o := orm.NewOrmUsingDB("hz_cygx")
	sql := `SELECT * FROM cygx_askserie_video_collection as art WHERE 1= 1 `
	if condition != "" {
		sql += condition
	}
	_, err = o.Raw(sql, pars).QueryRows(&items)
	return
}
