|
@@ -4,6 +4,7 @@ import (
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
"github.com/PuerkitoBio/goquery"
|
|
|
+ "hongze/hz_crm_api/models"
|
|
|
"hongze/hz_crm_api/models/company"
|
|
|
"hongze/hz_crm_api/models/cygx"
|
|
|
"hongze/hz_crm_api/services"
|
|
@@ -221,6 +222,7 @@ func HandleArticleAndYanxuanRecordList(items []*cygx.CygxArticleAndYanxuanRecord
|
|
|
var articleIds []int // 文章ID
|
|
|
var yanxuanSpecialIds []int // 研选专栏ID
|
|
|
var sellerCompanyIds []int // 公司ID
|
|
|
+ var mobiles []string // 手机号
|
|
|
for _, v := range items {
|
|
|
if v.Source == utils.CYGX_OBJ_ARTICLE {
|
|
|
articleIds = append(articleIds, v.SourceId)
|
|
@@ -229,12 +231,25 @@ func HandleArticleAndYanxuanRecordList(items []*cygx.CygxArticleAndYanxuanRecord
|
|
|
yanxuanSpecialIds = append(yanxuanSpecialIds, v.SourceId)
|
|
|
}
|
|
|
sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ mobiles = append(mobiles, v.Mobile)
|
|
|
}
|
|
|
|
|
|
sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
|
|
|
mapIndustrialLabel := GetArticleIndustrialLabelByArticleId(articleIds) // 关联产业
|
|
|
mapSubjectLabel := GetArticleSubjectLabelByArticleId(articleIds) // 关联标的
|
|
|
+
|
|
|
+ //根据手机号获取这些用户的信息
|
|
|
+ listUser, e := models.GetWxUserByOutboundMobiles(mobiles)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetWxUserOutboundMobiles, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapUserRealname := make(map[string]string)
|
|
|
+ for _, v := range listUser {
|
|
|
+ mapUserRealname[v.Mobile] = v.RealName
|
|
|
+ }
|
|
|
+
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
|
|
@@ -307,6 +322,9 @@ func HandleArticleAndYanxuanRecordList(items []*cygx.CygxArticleAndYanxuanRecord
|
|
|
item.CreateTime = v.CreateTime
|
|
|
item.UserId = v.UserId
|
|
|
item.RealName = v.RealName
|
|
|
+ if item.RealName == "" {
|
|
|
+ item.RealName = mapUserRealname[v.Mobile]
|
|
|
+ }
|
|
|
item.Mobile = v.Mobile
|
|
|
item.CompanyId = v.CompanyId
|
|
|
item.CompanyName = v.CompanyName
|