Procházet zdrojové kódy

Merge remote-tracking branch 'origin/feature/v1.0.9' into feature/v1.0.9

wkyuer před 1 měsícem
rodič
revize
7ebdd3ddb1
1 změnil soubory, kde provedl 11 přidání a 8 odebrání
  1. 11 8
      service/service.go

+ 11 - 8
service/service.go

@@ -192,7 +192,9 @@ func BuyProductList(this *entmanageapplication.BuyProductListReq) *entmanageappl
 			if provinceCount := common.IntAllDef(v["province_count"], -1); provinceCount > 0 {
 				switch provinceCount {
 				case 1:
-					productTypeSuffix = "单省版"
+					if !strings.Contains(product_type, "单省版") {
+						productTypeSuffix = "单省版"
+					}
 				default:
 					productTypeSuffix = "省份版"
 				}
@@ -393,14 +395,14 @@ func vipSetMap(orderData map[string]interface{}) (set map[string]interface{}, se
 	json.Unmarshal([]byte(common.ObjToString(orderData["filter"])), &vms)
 	set = map[string]interface{}{
 		"o_entniche": map[string]interface{}{
-			"i_trial": -1,                                              //已激活试用
+			"i_trial": -1,                                            //已激活试用
 			"o_area":  map[string]interface{}{"北京": []interface{}{}}, //设置地区
 			"o_buyset": map[string]interface{}{
 				"upgrade":         1,
 				"areacount":       vms.FinalAreaCount,
 				"newcitys":        []int{},
 				"buyerclasscount": -1,
-			},                               //购买内容 城市、省份、行业数量,                                  //购买内容 城市、省份、行业数量
+			}, //购买内容 城市、省份、行业数量,                                  //购买内容 城市、省份、行业数量
 			"a_buyerclass": []interface{}{}, //设置行业
 		},
 		"i_vip_expire_tip": 0, //消息提示初始化
@@ -429,10 +431,11 @@ func memberSetMap(userId, waitEmpowerId int64, orderData map[string]interface{})
 	filterMap := common.ObjToMap(orderData["filter"])
 	comboId := common.IntAll((*filterMap)["comboId"])
 	level := common.If(comboId == 0, 5, comboId).(int)
+	level = common.If(gconv.Int((*filterMap)["finalAreaCount"]) == 1, 6, level).(int)
 	payCycle := month(common.IntAll((*filterMap)["buy_cycle"]), common.IntAll((*filterMap)["buy_type"])) + month(common.IntAll((*filterMap)["give_cycle"]), common.IntAll((*filterMap)["give_type"]))
 
 	//payCycle := common.IntAll((*filterMap)["cycle"])
-	serversId := common.ObjToString((*filterMap)["serversId"])
+	serversId := gconv.Strings((*filterMap)["serviceIds"])
 	startTime := common.ObjToString(orderData["service_starttime"])
 	endTime := common.ObjToString(orderData["service_endtime"])
 	tmp := "2006-01-02 15:04:05"
@@ -444,11 +447,10 @@ func memberSetMap(userId, waitEmpowerId int64, orderData map[string]interface{})
 		dataType = 2
 	}
 	var (
-		areaCount = common.IntAllDef((*filterMap)["areaCount"], -1)
+		areaCount = common.IntAllDef((*filterMap)["finalAreaCount"], -1)
 		area      = common.If(areaCount > 0, map[string]interface{}{"北京": []string{}}, map[string]interface{}{}).(map[string]interface{})
 	)
-
-	areaCount = common.IntAllDef((*filterMap)["areaCount"], -1)
+	//areaCount = common.IntAllDef((*filterMap)["finalAreaCount"], -1)
 	set = map[string]interface{}{
 		"i_type": 1,
 		"o_member_jy": map[string]interface{}{
@@ -457,6 +459,7 @@ func memberSetMap(userId, waitEmpowerId int64, orderData map[string]interface{})
 		"o_entniche.i_areacount": areaCount,
 		"o_entniche.o_area":      area, //默认北京
 	}
+	log.Println("权益分配参数set:", set)
 	setEntUser = map[string]interface{}{
 		"i_member_status":    common.If(dataType == 1, level, -level),
 		"i_member_starttime": startdate.Unix(),
@@ -551,7 +554,7 @@ func memberSetMap(userId, waitEmpowerId int64, orderData map[string]interface{})
 			}
 		}
 	} else {
-		for _, s := range strings.Split(serversId, ",") {
+		for _, s := range serversId {
 			serverId, _ := strconv.Atoi(s)
 			mainId := serverId
 			if serverMap[serverId] != 0 {