|
|
@@ -39,9 +39,9 @@ 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]map[string]string) |
|
|
|
var rewardList = make(map[string]md.ExtendPriceRewardList) |
|
|
|
for _, v := range lvGrade.ExtendPriceRewardList { |
|
|
|
rewardList[v["coin_id"]] = v |
|
|
|
rewardList[v.CoinID] = v |
|
|
|
} |
|
|
|
//查出当前的数量 |
|
|
|
count, _ := eg.Where("source=? and lv=?", param["source"], param["level"]).Count(&model.UserLvBuyList{}) |
|
|
@@ -53,17 +53,32 @@ func ExtendPriceReward(eg *xorm.Engine, param map[string]string, cfg *comm_plan. |
|
|
|
} |
|
|
|
var extendReward = make(map[string]string) |
|
|
|
for _, coinId := range lvGrade.ReturnType { |
|
|
|
reward := rewardList[coinId] |
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
|
var pendingAmount = param["commission"] |
|
|
|
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 |
|
|
|
pendingAmount = param["integral"] |
|
|
|
} |
|
|
|
rewardAmount := reward["extend_bili"] |
|
|
|
rewardAmount := reward.Bili |
|
|
|
//如果等级一致 判断位置 |
|
|
|
if isTrue { |
|
|
|
position := count % zhios_order_relate_utils.StrToInt64(param["base_val"]) |
|
|
|
if isTrue && zhios_order_relate_utils.StrToInt(reward.BaseVal) > 0 { |
|
|
|
position := count % zhios_order_relate_utils.StrToInt64(reward.BaseVal) |
|
|
|
if position == 0 { |
|
|
|
rewardAmount = reward["extend_position_bili"] |
|
|
|
rewardAmount = reward.PositionBili |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|