浏览代码

总数查询修改

WH01243 2 年之前
父节点
当前提交
5abc0e5e8a
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      jyBXSubscribe/rpc/model/push.go

+ 2 - 3
jyBXSubscribe/rpc/model/push.go

@@ -592,10 +592,9 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 			// 无查询分配人员、是否已读
 			if spqp.IsRead == "" && len(staffs) == 0 {
 				//查询数量(需要去重)
-				countSql = fmt.Sprintf("select count(1) from %s a    where %s %s %s", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""))
+				//countSql = fmt.Sprintf("select count(1) from %s a    where %s %s %s", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""))
+				countSql = fmt.Sprintf("select count(1) from %s a  where %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr)
 				//列表查询
-				/*findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,a.attachment_count from %s a  where  %s %s %s order by a.date desc,a.id desc",
-				aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""))*/
 				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,a.attachment_count, IF(a.source is NULL,1,a.source) as  source  from %s a  where  %s %s order by a.date desc,a.id desc",
 					aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr)
 			} else {