package data_manage import ( "github.com/beego/beego/v2/client/orm" ) func GetUnSubUserOpenid(openIdstr string) (items []string, err error){ sql := `SELECT open_id FROM user_record WHERE open_id IS NOT NULL AND subscribe=0 AND create_platform=1 ` sql += ` AND open_id in (` + openIdstr + `) ` _, err = orm.NewOrm().Raw(sql).QueryRows(&items) return } func UpdateSubStatus(unSubIds string) (err error){ sql := "UPDATE user_record SET subscribe=1,subscribe_time=NOW() WHERE create_platform=1 " sql += ` AND open_id in (` + unSubIds + `) ` _, err = orm.NewOrm().Raw(sql).Exec() return }