Browse Source

no message

xingzai 6 months ago
parent
commit
908f483604
2 changed files with 41 additions and 3 deletions
  1. 17 3
      controllers/cygx/report_article.go
  2. 24 0
      models/wx_user.go

+ 17 - 3
controllers/cygx/report_article.go

@@ -1977,9 +1977,9 @@ func (this *IndustrialSubjectController) ReportMappingAdd() {
 	br.IsAddLog = true
 }
 
-//func init() {
-//	initart()
-//}
+func init() {
+	initart()
+}
 
 func initart() {
 	//行业
@@ -2106,6 +2106,12 @@ func initart() {
 			return
 		}
 
+		listUserFicc, err := models.GetWxUserRaiSllerListByUserMobileFiic(mobiles)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
+
 		mapuserMapbil := make(map[string]*models.WxUserSller)
 		var companyIds []int
 		for _, vuser := range listUser {
@@ -2130,6 +2136,14 @@ func initart() {
 			mapuserMapbil[vuser.Mobile] = vuser
 		}
 
+		for _, vuser := range listUserFicc {
+			vuser.Status = ""
+			vuser.SellerName = ""
+			if mapuserMapbil[vuser.Mobile] == nil {
+				mapuserMapbil[vuser.Mobile] = vuser
+			}
+		}
+
 		if len(list) > 0 {
 			for _, vPv := range list {
 				if !utils.ValidateMobileFormatat(vPv.Mobile) || mapMobileCy[vPv.Mobile] {

+ 24 - 0
models/wx_user.go

@@ -592,6 +592,30 @@ func GetWxUserRaiSllerListByUserMobile(mobiles []string) (list []*WxUserSller, e
 	return
 }
 
+// GetWxUserRaiSllerListByUserMobile 根据用户手机号获取权益相关用户信息
+func GetWxUserRaiSllerListByUserMobileFiic(mobiles []string) (list []*WxUserSller, err error) {
+	lenarr := len(mobiles)
+	if lenarr == 0 {
+		return
+	}
+	o := orm.NewOrm()
+	sql := ` SELECT
+				w.user_id,
+				w.real_name,
+				w.mobile,
+				c.company_name
+			FROM
+				wx_user AS w
+				INNER JOIN company_product AS p ON p.company_id = w.company_id
+				INNER JOIN company AS c ON c.company_id = w.company_id 
+			WHERE
+				1 = 1 
+				AND p.product_id = 1
+				AND w.mobile IN (` + utils.GetOrmInReplace(lenarr) + `)  `
+	_, err = o.Raw(sql, mobiles).QueryRows(&list)
+	return
+}
+
 // GetWxUserByCompanyIds 根据客户ID集合获取用户列表
 func GetWxUserByCompanyIds(companyIds []int) (items []*WxUser, err error) {
 	num := len(companyIds)