Browse Source

feat: 撤销代码

zhangxinlei1996 2 years ago
parent
commit
df4f09afb2
1 changed files with 4 additions and 7 deletions
  1. 4 7
      jyBXSubscribe/rpc/model/push.go

+ 4 - 7
jyBXSubscribe/rpc/model/push.go

@@ -602,11 +602,9 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 			// 无查询分配人员、是否已读
 			if spqp.IsRead == "" && len(staffs) == 0 {
 				//查询数量(需要去重)
-				countSql = fmt.Sprintf("select count(DISTINCT infoid) from %s a  where %s  %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
+				countSql = fmt.Sprintf("select count(1) from %s a  where %s  %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
 				//列表查询
-				//findSql = fmt.Sprintf("select a.id,a.infoid,REPLACE(a.matchkeys,'+',' ') as 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, userStr, strings.Join(querys, " and "))
-				findSql = fmt.Sprintf(`SELECT infoid, GROUP_CONCAT(DISTINCT source) sourceAll, REPLACE(MAX(matchkeys), '+', ' ') AS matchkeys,MAX(DATE) AS DATE, MAX(id) AS id , MAX(attachment_count) AS attachment_count FROM  %s a  where  %s %s group by infoid order by date desc,id desc`,
+				findSql = fmt.Sprintf("select a.id,a.infoid,REPLACE(a.matchkeys,'+',' ') as 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, userStr, strings.Join(querys, " and "))
 			} else {
 				//查询分配人员或是否已读
@@ -616,10 +614,9 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				} else if len(staffs) > 0 {
 					staffQuery += fmt.Sprintf(" and  a.userid in (0,'%s')  ", strings.Join(staffs, "','"))
 				}
-				countSql = fmt.Sprintf("select count(DISTINCT infoid) from %s a  where %s %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
+				countSql = fmt.Sprintf("select count(1) from %s a  where %s %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
 				//列表查询
-				//findSql = fmt.Sprintf("select a.id,a.infoid,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.attachment_count,IF(a.source is NULL,1,a.source) as  source from %s a  where %s %s  %s order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
-				findSql = fmt.Sprintf("SELECT infoid, GROUP_CONCAT(DISTINCT source) sourceAll, REPLACE(MAX(matchkeys), '+', ' ') AS matchkeys,MAX(DATE) AS DATE, MAX(id) AS id , MAX(attachment_count) AS attachment_count FROM %s a  where %s %s  %s group by infoid order by date desc,id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
+				findSql = fmt.Sprintf("select a.id,a.infoid,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.attachment_count,IF(a.source is NULL,1,a.source) as  source from %s a  where %s %s  %s order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
 			}
 		} else {
 			// 是否已读