ziwen 1 year ago
parent
commit
ae410b337a
3 changed files with 5 additions and 3 deletions
  1. 2 1
      models/wx_user.go
  2. 1 1
      models/yb/apply_record.go
  3. 2 1
      services/yb/apply_record.go

+ 2 - 1
models/wx_user.go

@@ -32,6 +32,7 @@ type WxUser struct {
 	OpenId              string    `orm:"column(open_id)" description:"微信openid"`
 	OpenId              string    `orm:"column(open_id)" description:"微信openid"`
 	Headimgurl          string    `description:"用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空"`
 	Headimgurl          string    `description:"用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空"`
 	UserLabel           string    `description:"查研观向用户标签"`
 	UserLabel           string    `description:"查研观向用户标签"`
+	MarkGroup           string    `description:"标记分组"`
 }
 }
 
 
 func AddWxUser(item *WxUser) (lastId int64, err error) {
 func AddWxUser(item *WxUser) (lastId int64, err error) {
@@ -521,4 +522,4 @@ func GetWxUserListCompanyId(companyId int) (list []*WxUserItem, err error) {
 	sql := ` SELECT* FROM wx_user  WHERE company_id = ?   `
 	sql := ` SELECT* FROM wx_user  WHERE company_id = ?   `
 	_, err = o.Raw(sql, companyId).QueryRows(&list)
 	_, err = o.Raw(sql, companyId).QueryRows(&list)
 	return
 	return
-}
+}

+ 1 - 1
models/yb/apply_record.go

@@ -158,7 +158,7 @@ SELECT
 	y.is_move,
 	y.is_move,
 	y.source,
 	y.source,
 	y.from_page,
 	y.from_page,
-	y.mark_group,
+	IF(y.mark_group = '' OR y.mark_group IS NULL, a.mark_group, y.mark_group) AS mark_group,
     y.company_name as user_company_name
     y.company_name as user_company_name
     #bp.seller_id,
     #bp.seller_id,
 	#bp.seller_name
 	#bp.seller_name

+ 2 - 1
services/yb/apply_record.go

@@ -319,9 +319,10 @@ func MarkGroupApplyRecord(applyRecordId, adminId, userId int, groupName string)
 	// 未处理过则进行标记
 	// 未处理过则进行标记
 	if wxUser.IsDeal == 0 {
 	if wxUser.IsDeal == 0 {
 		wxUser.IsDeal = 1
 		wxUser.IsDeal = 1
+		wxUser.MarkGroup = groupName
 		wxUser.LastUpdatedTime = time.Now()
 		wxUser.LastUpdatedTime = time.Now()
 		userUpdateCols := make([]string, 0)
 		userUpdateCols := make([]string, 0)
-		userUpdateCols = append(userUpdateCols, "IsDeal", "LastUpdatedTime")
+		userUpdateCols = append(userUpdateCols, "IsDeal", "MarkGroup", "LastUpdatedTime")
 		err = wxUser.Update(userUpdateCols)
 		err = wxUser.Update(userUpdateCols)
 		if err != nil {
 		if err != nil {
 			err = errors.New(fmt.Sprint("对应用户信息标记失败", err))
 			err = errors.New(fmt.Sprint("对应用户信息标记失败", err))