Просмотр исходного кода

Merge branch 'cygx_fix_bug_08-02' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

xingzai 1 год назад
Родитель
Сommit
a9867b3852
2 измененных файлов с 5 добавлено и 2 удалено
  1. 3 0
      controllers/cygx/user.go
  2. 2 2
      models/cygx/cygx_user.go

+ 3 - 0
controllers/cygx/user.go

@@ -730,6 +730,9 @@ func (this *UserController) TableDetail() {
 			endDate += " 23:59:59"
 			condition += ` AND r.create_time <= '` + endDate + `' `
 		}
+		if wxUser.Mobile == "" {
+			wxUser.Mobile = wxUser.Email
+		}
 		total, err = cygx.GetCygxArticleHistoryCount(wxUser.Mobile, wxUser.Email, condition)
 		if err != nil {
 			br.Msg = "获取信息失败"

+ 2 - 2
models/cygx/cygx_user.go

@@ -353,8 +353,8 @@ type CygxChartResp struct {
 // 获取阅读记录数量
 func GetCygxArticleHistoryCount(mobile, email, condition string) (count int, err error) {
 	o := orm.NewOrm()
-	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_article_history_record_all as r  INNER JOIN cygx_article  as art  ON  art.article_id = r.article_id  WHERE   r.mobile  = ?  AND is_del = 0 ` + condition + `  OR ( email = ? AND email <> ''  AND is_del = 0  ` + condition + `) `
-	err = o.Raw(sqlCount, mobile, email).QueryRow(&count)
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_article_history_record_all as r  INNER JOIN cygx_article  as art  ON  art.article_id = r.article_id  WHERE   r.mobile  = '` + mobile + `'  AND is_del = 0 ` + condition
+	err = o.Raw(sqlCount).QueryRow(&count)
 	return
 }