|
@@ -6,14 +6,14 @@ import (
|
|
|
|
|
|
func GetUnSubUserOpenid(openIdstr string) (items []string, err error){
|
|
|
sql := `SELECT open_id FROM user_record
|
|
|
- WHERE open_id IS NOT NULL AND subscribe=0 `
|
|
|
+ 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 WHERE 1=1 "
|
|
|
+ sql := "UPDATE user_record SET subscribe=1,subscribe_time=NOW() WHERE 1=1 AND create_platform=1 "
|
|
|
sql += ` AND open_id in (` + unSubIds + `) `
|
|
|
_, err = orm.NewOrm().Raw(sql).Exec()
|
|
|
return
|