diff --git a/hdl/hdl_upgrade.go b/hdl/hdl_upgrade.go index c1cc4fb..689c949 100644 --- a/hdl/hdl_upgrade.go +++ b/hdl/hdl_upgrade.go @@ -90,6 +90,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine, t := time.Now() var expire time.Time //订单时间修改 + amount := "" if payOrdId > 0 { ord, err := db.UserLevelOrderById(eg, zhios_condition_statistics_utils.Int64ToStr(payOrdId)) if err != nil { @@ -99,6 +100,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine, if ord.ExpireAt.Unix() < t.Unix() && ord.CreateAt.Format("2006-01-02 15:04:05") != ord.ExpireAt.Format("2006-01-02 15:04:05") && ord.DateType != 4 { return false, 0 } + amount = ord.PayAmount switch ord.DateType { case 1: // 月 @@ -141,7 +143,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine, return false, 0 } //升级奖励定制 - UpgradeReward(eg, user, zhios_condition_statistics_utils.Int64ToStr(payOrdId)) + UpgradeReward(eg, user, zhios_condition_statistics_utils.Int64ToStr(payOrdId), amount) eg.Where("uid=?", user.Uid).Cols("date").Update(&model.OneCirclesUserLvTime{Date: time.Now()}) AutoAudit = 1 var task model.UserLevelUpgradeTask @@ -156,7 +158,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine, } return result, AutoAudit } -func UpgradeReward(eg *xorm.Engine, user *model.User, oid string) { +func UpgradeReward(eg *xorm.Engine, user *model.User, oid, amount string) { buyCouponLvReward, _ := db.SysCfgGetOne(eg, "buy_coupon_lv_reward") if buyCouponLvReward == nil { return @@ -175,7 +177,7 @@ func UpgradeReward(eg *xorm.Engine, user *model.User, oid string) { svc.AddCouponRecord(eg, user, "ordinary", v1.Amount) } if zhios_condition_statistics_utils.StrToInt(v1.Id) > 0 { - svc.AddCoin(eg, zhios_condition_statistics_utils.StrToFloat64(v1.Amount), "升级赠送", oid, 1, 188, user.Uid, zhios_condition_statistics_utils.StrToInt(v1.Id)) + svc.AddCoin(eg, zhios_condition_statistics_utils.StrToFloat64(v1.Amount), "升级赠送", oid, 1, 188, user.Uid, zhios_condition_statistics_utils.StrToInt(v1.Id), amount) } } } diff --git a/svc/svc_reward.go b/svc/svc_reward.go index 641e220..9f3103a 100644 --- a/svc/svc_reward.go +++ b/svc/svc_reward.go @@ -57,7 +57,7 @@ func AddCouponRecord(eg *xorm.Engine, user *model.User, pvdType, coupon string) return true } -func AddCoin(eg *xorm.Engine, money float64, Title, ordId string, types, transferType, uid, coinId int) (int64, error) { +func AddCoin(eg *xorm.Engine, money float64, Title, ordId string, types, transferType, uid, coinId int, amount string) (int64, error) { //定制客户存入购物金分期 req := map[string]string{ "coin_id": zhios_condition_statistics_utils.IntToStr(coinId), @@ -65,6 +65,7 @@ func AddCoin(eg *xorm.Engine, money float64, Title, ordId string, types, transfe "uid": zhios_condition_statistics_utils.IntToStr(uid), "oid": ordId, "amount": zhios_condition_statistics_utils.Float64ToStr(money), + "price": amount, } state := service_award_dividend.AddPeriodEg(eg, req) if state == 3 {