|
@@ -27,9 +27,10 @@ type OpenIdList struct {
|
|
|
}
|
|
|
|
|
|
type OpenIdMobileList struct {
|
|
|
- OpenId string
|
|
|
- UserId int
|
|
|
- Mobile string `description:"手机号"`
|
|
|
+ OpenId string
|
|
|
+ UserId int
|
|
|
+ Mobile string `description:"手机号"`
|
|
|
+ CompanyId int `description:"公司ID"`
|
|
|
}
|
|
|
|
|
|
func GetCygxUserRecord() (items []*CygxUserRecord, err error) {
|
|
@@ -41,30 +42,39 @@ func GetCygxUserRecord() (items []*CygxUserRecord, err error) {
|
|
|
|
|
|
// 获取所有有权限的用户的opid
|
|
|
func GetCygxUserRecordPower(chartPermissionIds string) (items []*OpenIdList, err error) {
|
|
|
- //o := orm.NewOrm()
|
|
|
- //sql := `SELECT
|
|
|
- // cr.open_id,
|
|
|
- // u.user_id,
|
|
|
- // u.company_id,
|
|
|
- // u.real_name,
|
|
|
- // u.mobile
|
|
|
- // FROM
|
|
|
- // company_report_permission AS p
|
|
|
- // INNER JOIN wx_user AS u ON u.company_id = p.company_id
|
|
|
- // INNER JOIN user_record AS r ON r.user_id = u.user_id
|
|
|
- // INNER JOIN cygx_user_record AS cr ON cr.union_id = r.union_id
|
|
|
- // WHERE
|
|
|
- // p.chart_permission_id IN (` + chartPermissionIds + `)
|
|
|
- // AND r.create_platform = 4
|
|
|
- // AND p.STATUS IN ('正式','试用','永续') GROUP BY cr.open_id `
|
|
|
- //_, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ listMobile, err := GetCygxUserRecordPowerMobileList(chartPermissionIds)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var mobileArr []string
|
|
|
+ for _, v := range listMobile {
|
|
|
+ if v.Mobile != "" {
|
|
|
+ mobileArr = append(mobileArr, v.Mobile)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mobileLen := len(mobileArr)
|
|
|
+ if mobileLen == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ openIdList, err := GetUserRecordListByMobileArr(mobileArr)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ items = openIdList
|
|
|
+ return
|
|
|
+}
|
|
|
|
|
|
+// 获取所有有权限的用户的opid
|
|
|
+func GetCygxUserRecordPowerArticle(chartPermissionIds string) (items []*OpenIdList, err error) {
|
|
|
listMobile, err := GetCygxUserRecordPowerMobileList(chartPermissionIds)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
var mobileArr []string
|
|
|
for _, v := range listMobile {
|
|
|
+ if v.CompanyId == utils.JMCJ_COMPANY_ID {
|
|
|
+ continue //需求池 1043:深圳进门财经科技股份有限公司下所有的账号,所有活动的新增修改都做推送,所有的报告的新增修改都不做推送。
|
|
|
+ }
|
|
|
if v.Mobile != "" {
|
|
|
mobileArr = append(mobileArr, v.Mobile)
|
|
|
}
|