WH01243 преди 2 години
родител
ревизия
4e1e14a6de
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      jyBXSubscribe/rpc/model/push.go

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

@@ -594,8 +594,10 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				//查询数量(需要去重)
 				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 ", ""))
 				//列表查询
-				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 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 {
 				//查询分配人员或是否已读
 				staffQuery := " 1=1 "