|
|
@@ -39,9 +39,20 @@ func ExtendPriceReward(eg *xorm.Engine, param map[string]string, cfg *comm_plan. |
|
|
|
return map[string]string{"0": "0"}, 0 |
|
|
|
} |
|
|
|
lvGrade := subsidyTmp[parentUser.Level] |
|
|
|
var rewardList = make(map[string]md.ExtendPriceRewardList) |
|
|
|
for _, v := range lvGrade.ExtendPriceRewardList { |
|
|
|
rewardList[v.CoinID] = v |
|
|
|
var rewardList = make(map[string]md.ExtendPriceRewardListDetail) |
|
|
|
if param["source"] == "mall_goods_extend_price" { |
|
|
|
rewardList = lvGrade.ExtendPriceRewardUpLv |
|
|
|
} |
|
|
|
if param["source"] == "regional_agent_pay" { |
|
|
|
if param["level"] == "1" { |
|
|
|
rewardList = lvGrade.ExtendPriceRewardProvince |
|
|
|
} |
|
|
|
if param["level"] == "2" { |
|
|
|
rewardList = lvGrade.ExtendPriceRewardCity |
|
|
|
} |
|
|
|
if param["level"] == "3" { |
|
|
|
rewardList = lvGrade.ExtendPriceRewardArea |
|
|
|
} |
|
|
|
} |
|
|
|
//查出当前的数量 |
|
|
|
count, _ := eg.Where("source=? and lv=?", param["source"], param["level"]).Count(&model.UserLvBuyList{}) |
|
|
@@ -53,22 +64,7 @@ func ExtendPriceReward(eg *xorm.Engine, param map[string]string, cfg *comm_plan. |
|
|
|
} |
|
|
|
var extendReward = make(map[string]string) |
|
|
|
for _, coinId := range lvGrade.ReturnType { |
|
|
|
rewardData := rewardList[coinId] |
|
|
|
reward := md.ExtendPriceRewardListDetail{} |
|
|
|
if param["source"] == "mall_goods_extend_price" { |
|
|
|
reward = rewardData.UpLv |
|
|
|
} |
|
|
|
if param["source"] == "regional_agent_pay" { |
|
|
|
if param["level"] == "1" { |
|
|
|
reward = rewardData.ProvinceAgent |
|
|
|
} |
|
|
|
if param["level"] == "2" { |
|
|
|
reward = rewardData.CityAgent |
|
|
|
} |
|
|
|
if param["level"] == "3" { |
|
|
|
reward = rewardData.AreaAgent |
|
|
|
} |
|
|
|
} |
|
|
|
reward := rewardList[coinId] |
|
|
|
var pendingAmount = param["commission"] |
|
|
|
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 |
|
|
|
pendingAmount = param["integral"] |
|
|
|