|
@@ -728,10 +728,6 @@ func (i *Info) AppNewUerSales() {
|
|
|
m["i_ts_guide"] = 1
|
|
|
}
|
|
|
if products != "" || infoMapArea != "" {
|
|
|
- area := ""
|
|
|
- if infoMapArea != "" {
|
|
|
- area = processArea(areas)
|
|
|
- }
|
|
|
keyWord := strings.Split(products, ",")
|
|
|
//
|
|
|
key := []string{}
|
|
@@ -754,7 +750,16 @@ func (i *Info) AppNewUerSales() {
|
|
|
if memberJy == nil {
|
|
|
memberJy = &map[string]interface{}{}
|
|
|
}
|
|
|
- SetArea(*memberJy, m, area, types)
|
|
|
+ if infoMapArea != "" {
|
|
|
+ limit := -1
|
|
|
+ // 判断是不是单省版
|
|
|
+ if qu.Int64All((*memberJy)["i_areacount"]) > 0 {
|
|
|
+ limit = qu.IntAll((*memberJy)["i_areacount"])
|
|
|
+ }
|
|
|
+ areaList := processArea(areas, limit)
|
|
|
+ SetArea(*memberJy, m, areaList, types)
|
|
|
+
|
|
|
+ }
|
|
|
Items(*memberJy, m, key, types)
|
|
|
} else if data.Data.Vip.Status > 0 {
|
|
|
types = "o_vipjy"
|
|
@@ -787,7 +792,10 @@ func (i *Info) AppNewUerSales() {
|
|
|
}
|
|
|
m["o_jy"] = (*oJy)
|
|
|
}
|
|
|
- SetArea(*oJy, m, area, types)
|
|
|
+ if infoMapArea != "" {
|
|
|
+ areaList := processArea(areas, 1)
|
|
|
+ SetArea(*oJy, m, areaList, types)
|
|
|
+ }
|
|
|
}
|
|
|
go SetLog(userId, types)
|
|
|
if len(m) > 0 && m["i_ts_guide"] == 1 {
|
|
@@ -841,22 +849,28 @@ func (i *Info) AppNewUerSales() {
|
|
|
|
|
|
/*
|
|
|
(2)如业务区域为全国,订阅区域按照“北京”同步;
|
|
|
-(3)如业务区域选择了多个,则随机将其中1个区域同步至“订阅区域”内。
|
|
|
+(3)如业务区域选择了多个,则随机将其中1个区域同步至“订阅区域”内。 p562
|
|
|
*/
|
|
|
-func processArea(areaStr string) (area string) {
|
|
|
+
|
|
|
+// 大会员地区全同步 p618
|
|
|
+// 1. 如若是付费用户:在该用户地区权限范围内的话,都反显;不在地区权限范围内的,就随机取权限范围内的1个或部分地区展示;
|
|
|
+// 2. 免费用户:保持现状。
|
|
|
+func processArea(areaStr string, limit int) (areaList []string) {
|
|
|
areaStrList := strings.Split(areaStr, ",")
|
|
|
for i := 0; i < len(areaStrList); i++ {
|
|
|
if areaStrList[i] == "广州" {
|
|
|
areaStrList[i] = "广东"
|
|
|
}
|
|
|
+ if areaStrList[i] == "全国" && limit != -1 {
|
|
|
+ areaStrList[i] = "北京"
|
|
|
+ }
|
|
|
if areaStrList[i] != "" && areaStrList[i] != "全国" {
|
|
|
- area = areaStrList[i]
|
|
|
+ areaList = append(areaList, areaStrList[i])
|
|
|
+ }
|
|
|
+ if limit != -1 && len(areaList) >= limit {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if area == "" {
|
|
|
- area = "北京"
|
|
|
- }
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -930,11 +944,14 @@ func Items(jy, m map[string]interface{}, keyWord []string, types string) {
|
|
|
m[types] = jy
|
|
|
}
|
|
|
}
|
|
|
-func SetArea(jy, m map[string]interface{}, area, types string) {
|
|
|
+func SetArea(jy, m map[string]interface{}, areas []string, types string) {
|
|
|
o_area, ok := jy["o_area"].(map[string]interface{})
|
|
|
- if (!ok || len(o_area) <= 0) && area != "" {
|
|
|
- jy["o_area"] = map[string]interface{}{
|
|
|
- area: []interface{}{}}
|
|
|
+ if (!ok || len(o_area) <= 0) && len(areas) != 0 {
|
|
|
+ o_area = map[string]interface{}{}
|
|
|
+ for i := 0; i < len(areas); i++ {
|
|
|
+ o_area[areas[i]] = []interface{}{}
|
|
|
+ }
|
|
|
+ jy["o_area"] = o_area
|
|
|
m[types] = jy
|
|
|
}
|
|
|
}
|