user_record.go 606 B

1234567891011121314151617181920
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. func GetUnSubUserOpenid(openIdstr string) (items []string, err error){
  6. sql := `SELECT open_id FROM user_record
  7. WHERE open_id IS NOT NULL AND subscribe=0 AND create_platform=1 `
  8. sql += ` AND open_id in (` + openIdstr + `) `
  9. _, err = orm.NewOrm().Raw(sql).QueryRows(&items)
  10. return
  11. }
  12. func UpdateSubStatus(unSubIds string) (err error){
  13. sql := "UPDATE user_record SET subscribe=1,subscribe_time=NOW() WHERE create_platform=1 "
  14. sql += ` AND open_id in (` + unSubIds + `) `
  15. _, err = orm.NewOrm().Raw(sql).Exec()
  16. return
  17. }