浏览代码

fix sub time and platform

ziwen 2 年之前
父节点
当前提交
9981448e73
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      models/data_manage/user_record.go

+ 2 - 2
models/data_manage/user_record.go

@@ -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