|
|
@@ -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) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|