package cygx

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

type CygxYanxuanSpecialCollectResp struct {
	CygxYanxuanSpecialCollectId int    `orm:"column(cygx_yanxuan_special_collect_id);pk"`
	UserId                      int    // 用户ID
	Mobile                      string // 手机号
	Email                       string // 邮箱
	CompanyId                   int    // 公司ID
	CompanyName                 string // 公司名称
	RealName                    string // 用户实际名称
	SellerName                  string // 所属销售
	CreateTime                  string // 创建时间
	ModifyTime                  string // 修改时间
	RegisterPlatform            int    // 来源 1小程序,2:网页
	YanxuanSpecialId            int    // cygx_yanxuan_special 表主键ID
}

// 列表
func GetCygxYanxuanSpecialCollectList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxYanxuanSpecialCollectResp, err error) {
	o := orm.NewOrmUsingDB("hz_cygx")
	sql := `SELECT * FROM cygx_yanxuan_special_collect as art WHERE 1= 1 `
	if condition != "" {
		sql += condition
	}
	sql += ` LIMIT ?,?  `
	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
	return
}

type GetCygxYanxuanSpecialCollectResp struct {
	List []*CygxYanxuanSpecialCollectResp
}

type CygxYanxuanSpecialRecordResp struct {
	CygxYanxuanSpecialRecordId int    `orm:"column(cygx_yanxuan_special_record_id);pk"`
	UserId                     int    // 用户ID
	Mobile                     string // 手机号
	Email                      string // 邮箱
	CompanyId                  int    // 公司ID
	CompanyName                string // 公司名称
	RealName                   string // 用户实际名称
	SellerName                 string // 所属销售
	CreateTime                 string // 创建时间
	ModifyTime                 string // 修改时间
	RegisterPlatform           int    // 来源 1小程序,2:网页
	YanxuanSpecialId           int    // cygx_yanxuan_special 表主键ID
	StopTime                   int    // 停留时间
}

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