|
@@ -98,6 +98,9 @@ type SubPushQueryParam struct {
|
|
FileExists string //是否有附件;默认全部;1:有附件;-1:无附件
|
|
FileExists string //是否有附件;默认全部;1:有附件;-1:无附件
|
|
EntUserId string //商机管理用户id
|
|
EntUserId string //商机管理用户id
|
|
DeptId string //商机管理用户部门id
|
|
DeptId string //商机管理用户部门id
|
|
|
|
+ IsRead string //是否已读
|
|
|
|
+ Source string //信息来源
|
|
|
|
+ Staffs []string //分发人员
|
|
BaseServiceMysql *mysql.Mysql
|
|
BaseServiceMysql *mysql.Mysql
|
|
NewUserId int64
|
|
NewUserId int64
|
|
IsEnt bool
|
|
IsEnt bool
|
|
@@ -370,6 +373,19 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
} else if starttime == 0 && endtime > 0 {
|
|
} else if starttime == 0 && endtime > 0 {
|
|
userStr += fmt.Sprintf(" and a.date<=%d", endtime)
|
|
userStr += fmt.Sprintf(" and a.date<=%d", endtime)
|
|
}
|
|
}
|
|
|
|
+ // 是否已读
|
|
|
|
+ if spqp.IsRead != "" {
|
|
|
|
+ if spqp.IsRead == "0" {
|
|
|
|
+ userStr += " and a.isvisit=0"
|
|
|
|
+ } else if spqp.IsRead == "1" {
|
|
|
|
+ userStr += " and a.isvisit=1"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 信息来源
|
|
|
|
+ if spqp.Source == "1" || spqp.Source == "2" || spqp.Source == "3" {
|
|
|
|
+ userStr += " and a.source=" + spqp.Source
|
|
|
|
+ }
|
|
|
|
+
|
|
if spqp.Area != "" || spqp.City != "" {
|
|
if spqp.Area != "" || spqp.City != "" {
|
|
var sqlAreaCity = ""
|
|
var sqlAreaCity = ""
|
|
//城市
|
|
//城市
|
|
@@ -509,7 +525,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
}
|
|
}
|
|
//判断是企业管理员还是部门管理员 部门管理员获取所有子部门
|
|
//判断是企业管理员还是部门管理员 部门管理员获取所有子部门
|
|
userEnt := EntInfo(common.IntAll(spqp.EntId), common.IntAll(spqp.EntUserId))
|
|
userEnt := EntInfo(common.IntAll(spqp.EntId), common.IntAll(spqp.EntUserId))
|
|
- if userEnt.Role_admin_department { //部门管理员 获取所有部门和子部门员工
|
|
|
|
|
|
+ if userEnt.Role_admin_department && len(spqp.Staffs) == 0 { //部门管理员 获取所有部门和子部门员工
|
|
users := GetDisUsers(common.IntAll(spqp.EntId), userEnt.Dept.Id)
|
|
users := GetDisUsers(common.IntAll(spqp.EntId), userEnt.Dept.Id)
|
|
var userIds []string
|
|
var userIds []string
|
|
if users != nil && len(*users) > 0 {
|
|
if users != nil && len(*users) > 0 {
|
|
@@ -522,6 +538,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
result = []*bxsubscribe.SubscribeInfo{}
|
|
result = []*bxsubscribe.SubscribeInfo{}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ } else if len(spqp.Staffs) != 0 {
|
|
|
|
+ userStr += fmt.Sprintf(" and a.userid in (%s) ", strings.Join(spqp.Staffs, ","))
|
|
}
|
|
}
|
|
|
|
|
|
//查询数量(需要去重)
|
|
//查询数量(需要去重)
|