Sfoglia il codice sorgente

Merge branch 'dev/v1.1.19.1_wky' of BaseService/jyMicroservices into hotfix/v1.1.19.1

wangkaiyue 2 anni fa
parent
commit
713dd92860
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      jyBXSubscribe/rpc/model/push.go

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

@@ -580,10 +580,10 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				staffs = spqp.Staffs
 			}
 			// 空查询优化,不走关联表计算数量
-			if len(querys) == 0 {
-				countSql = fmt.Sprintf("select count(1) from %s a  %s where  %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, leftJoinStr, userStr)
+			if len(querys) == 1 {
+				countSql = fmt.Sprintf("select count(1) from %s a  %s where 1=1 %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, leftJoinStr, userStr)
 				//列表查询
-				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count, IF(a.source is NULL,1,a.source) as  source  from %s a LEFT JOIN %s b ON a.infoid = b.infoid  %s where  %s  order by a.date desc,a.id desc",
+				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count, IF(a.source is NULL,1,a.source) as  source  from %s a LEFT JOIN %s b ON a.infoid = b.infoid  %s where 1=1 %s  order by a.date desc,a.id desc",
 					aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, userStr)
 			} else {
 				// 无查询分配人员、是否已读