package models import ( "github.com/beego/beego/v2/client/orm" "hongze/hongze_task/utils" ) type ETATrialListRespItem struct { EtaTrialId int `orm:"column(eta_trial_id);pk" description:"eta试用客户id"` UserName string `description:"客户名称"` CompanyName string `description:"客户公司姓名"` Position string `description:"职位"` Mobile string `description:"手机号"` ActiveTime string `description:"累计活跃时长"` LastLoginTime string `description:"最后一次登陆时间"` SellerId int `description:"销售id"` Seller string `description:"销售员名称"` InterestModule string `description:"感兴趣模块"` Expiration int `description:"账号到期时长"` Enabled int `description:"1:有效,0:禁用"` IndexNum int `description:"累计添加指标"` ChartNum int `description:"累计添加图表"` Password string Account string CreateTime string ModifyTime string } func GetETATrialDisableList(endDate string) (items []*ETATrialListRespItem, err error) { o := orm.NewOrm() sql := `SELECT * FROM eta_trial WHERE modify_time < '`+endDate+`' ` _, err = o.Raw(sql).QueryRows(&items) return } func UpdateETATrialDisable(disableIds []int) (err error) { o := orm.NewOrm() sql := `UPDATE eta_trial SET enabled = 0 WHERE eta_trial_id IN (` + utils.GetOrmInReplace(len(disableIds)) + `) ` _, err = o.Raw(sql, disableIds, ).Exec() return } func UpdateETATrialAdminDisable(disableMobiles []string) (err error) { o := orm.NewOrmUsingDB("weekly_trial") sql := `UPDATE admin SET enabled = 0 WHERE mobile IN (` + utils.GetOrmInReplace(len(disableMobiles)) + `) ` _, err = o.Raw(sql,disableMobiles).Exec() return }