Pārlūkot izejas kodu

未读消息人员查询

WH01243 2 gadi atpakaļ
vecāks
revīzija
2c875751de
1 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. 5 4
      jyBXSubscribe/rpc/model/push.go

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

@@ -560,7 +560,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				result = []*bxsubscribe.SubscribeInfo{}
 				return
 			}
-			if userEnt.Role_admin_department { //部门管理员 获取所有部门和子部门员工
+			if userEnt.Role_admin_department { //
+				// 部门管理员 获取所有部门和子部门员工
 				users := GetDisUsers(common.IntAll(spqp.EntId), userEnt.Dept.Id)
 				if users != nil && len(*users) > 0 {
 					for _, v := range *users {
@@ -595,16 +596,16 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				staffQuery := " 1=1 "
 				if len(spqp.Staffs) > 0 {
 					staffQuery += fmt.Sprintf(" and  a.userid in ('%s')  ", strings.Join(staffs, "','"))
-				} else {
+				} else if len(staffs) > 0 {
 					staffQuery += fmt.Sprintf(" and  a.userid in (0,'%s')  ", strings.Join(staffs, "','"))
 				}
-				if spqp.IsRead != "" {
+				/*if spqp.IsRead != "" {
 					if spqp.IsRead == "0" {
 						staffQuery += " and a.isvisit IS NULL"
 					} else if spqp.IsRead == "1" {
 						staffQuery += " and a.isvisit=1"
 					}
-				}
+				}*/
 				//countSql = fmt.Sprintf("select count(1) from %s a  where %s %s and ((%s) or EXISTS (SELECT 1 from %s c  WHERE c.source=3 %s and %s and a.id=c.pid and (%s))) ", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, staffQuery, aboutDbMsg[s.ModuleFlag].MysqlTable, strings.ReplaceAll(userStr, "a.", "c."), strings.Join(querys, " and "), strings.ReplaceAll(staffQuery, "a.", "c."))
 				countSql = fmt.Sprintf("select count(1) from %s a  where %s %s and %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, staffQuery)