浏览代码

sql修改

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

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

@@ -593,7 +593,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 					aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
 			} else {
 				//查询分配人员或是否已读
-				staffQuery := " 1=1 "
+				staffQuery := "and  1=1 "
 				if len(spqp.Staffs) > 0 {
 					staffQuery += fmt.Sprintf(" and  a.userid in ('%s')  ", strings.Join(staffs, "','"))
 				} else if len(staffs) > 0 {
@@ -637,7 +637,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				}
 			}
 			//查询数量
-			countSql = fmt.Sprintf("select count(1) as count from %s  a  where 1=1 %s and %s", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
+			countSql = fmt.Sprintf("select count(1) as count from %s  a  where  %s and %s", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
 			//列表查询语句
 			findSql = "select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,a.attachment_count"
 			if s.ModuleFlag == EntnicheFlag {