Browse Source

更新

master
huangjiajun 1 month ago
parent
commit
4ee24ecfca
2 changed files with 7 additions and 4 deletions
  1. +5
    -3
      hdl/hdl_upgrade.go
  2. +2
    -1
      svc/svc_reward.go

+ 5
- 3
hdl/hdl_upgrade.go View File

@@ -90,6 +90,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine,
t := time.Now() t := time.Now()
var expire time.Time var expire time.Time
//订单时间修改 //订单时间修改
amount := ""
if payOrdId > 0 { if payOrdId > 0 {
ord, err := db.UserLevelOrderById(eg, zhios_condition_statistics_utils.Int64ToStr(payOrdId)) ord, err := db.UserLevelOrderById(eg, zhios_condition_statistics_utils.Int64ToStr(payOrdId))
if err != nil { 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 { 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 return false, 0
} }
amount = ord.PayAmount
switch ord.DateType { switch ord.DateType {
case 1: case 1:
// 月 // 月
@@ -141,7 +143,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine,
return false, 0 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()}) eg.Where("uid=?", user.Uid).Cols("date").Update(&model.OneCirclesUserLvTime{Date: time.Now()})
AutoAudit = 1 AutoAudit = 1
var task model.UserLevelUpgradeTask var task model.UserLevelUpgradeTask
@@ -156,7 +158,7 @@ func CommUplv(params map[string]string, blockStarChain string, eg *xorm.Engine,
} }
return result, AutoAudit 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") buyCouponLvReward, _ := db.SysCfgGetOne(eg, "buy_coupon_lv_reward")
if buyCouponLvReward == nil { if buyCouponLvReward == nil {
return return
@@ -175,7 +177,7 @@ func UpgradeReward(eg *xorm.Engine, user *model.User, oid string) {
svc.AddCouponRecord(eg, user, "ordinary", v1.Amount) svc.AddCouponRecord(eg, user, "ordinary", v1.Amount)
} }
if zhios_condition_statistics_utils.StrToInt(v1.Id) > 0 { 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)
} }
} }
} }


+ 2
- 1
svc/svc_reward.go View File

@@ -57,7 +57,7 @@ func AddCouponRecord(eg *xorm.Engine, user *model.User, pvdType, coupon string)
return true 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{ req := map[string]string{
"coin_id": zhios_condition_statistics_utils.IntToStr(coinId), "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), "uid": zhios_condition_statistics_utils.IntToStr(uid),
"oid": ordId, "oid": ordId,
"amount": zhios_condition_statistics_utils.Float64ToStr(money), "amount": zhios_condition_statistics_utils.Float64ToStr(money),
"price": amount,
} }
state := service_award_dividend.AddPeriodEg(eg, req) state := service_award_dividend.AddPeriodEg(eg, req)
if state == 3 { if state == 3 {


Loading…
Cancel
Save