Browse Source

Merge branch 'dev/v3.1.19_fu' of jianyu/salesLeads into feature/v3.1.19

fuwencai 1 year ago
parent
commit
e651481339
1 changed files with 10 additions and 13 deletions
  1. 10 13
      src/service/action/info.go

+ 10 - 13
src/service/action/info.go

@@ -717,14 +717,18 @@ func (i *Info) AppNewUerSales() {
 			infoMap["createtime"] = tm
 			infoMap["source"] = "app_xzcyh"
 			products := qu.InterfaceToStr(infoMap["product"])
-			area := processArea(areas)
+			infoMapArea := qu.InterfaceToStr(infoMap["area"])
 			//data, ok := MQFW.FindById("user", userid, `{"o_jy":1,"o_vipjy":1,"o_member_jy":1,"i_vip_status":1,"i_member_status":1,"s_phone":1,"s_m_phone":1}`)
 			data := jy.GetBigVipUserBaseMsg(i.Session(), *Middleground)
 			if data != nil {
 				if qu.InterfaceToStr(infoMap["phone"]) == "" {
 					infoMap["phone"] = data.Data.Free.Phone
 				}
-				if products != "" || area != "" {
+				if products != "" || infoMapArea != "" {
+					area := ""
+					if infoMapArea != "" {
+						processArea(areas)
+					}
 					keyWord := strings.Split(products, ",")
 					//
 					key := []string{}
@@ -754,16 +758,14 @@ func (i *Info) AppNewUerSales() {
 						if vipJy == nil {
 							vipJy = &map[string]interface{}{}
 						}
-						SetArea(*memberJy, m, area, types)
+						SetArea(*vipJy, m, area, types)
 						Items(*vipJy, m, key, types)
 					} else {
 						types = "o_jy"
 						if oJy == nil || len(*oJy) == 0 {
 							oJy = &map[string]interface{}{}
 						}
-						o_area, areaB := (*oJy)["o_area"].(map[string]interface{})
 						a_key, keyB := (*oJy)["a_key"].([]interface{})
-
 						if (!keyB || a_key == nil || len(a_key) == 0) && len(key) > 0 {
 							//不存在关键词 填充
 							var arryMap []map[string]interface{}
@@ -783,16 +785,11 @@ func (i *Info) AppNewUerSales() {
 							}
 							m["o_jy"] = (*oJy)
 						}
-						if (!areaB || len(o_area) <= 0) && area != "" {
-							(*oJy)["o_area"] = map[string]interface{}{
-								area: []interface{}{},
-							}
-							m[types] = (*oJy)
-						}
-
+						SetArea(*oJy, m, area, types)
 					}
 					go SetLog(userId, types)
 					if len(m) > 0 {
+						m["i_ts_guide"] = 2
 						jy.Publish(Mgo_Log, Sysconfig.Nsq, Sysconfig.NsqTopic, "task", qu.ObjToString(i.GetSession("mgoUserId")), jy.Jywx_node1, map[string]interface{}{
 							"code":       1015, //首次订阅
 							"types":      "subscribeKeyWords",
@@ -933,7 +930,7 @@ func Items(jy, m map[string]interface{}, keyWord []string, types string) {
 }
 func SetArea(jy, m map[string]interface{}, area, types string) {
 	o_area, ok := jy["o_area"].(map[string]interface{})
-	if !ok || len(o_area) <= 0 {
+	if (!ok || len(o_area) <= 0) && area != "" {
 		jy["o_area"] = map[string]interface{}{
 			area: []interface{}{}}
 		m[types] = jy