|
|
@@ -210,6 +210,9 @@ func DealUserConsumeIntegral(session *xorm.Session, subsidyWithUser *model.Subsi |
|
|
|
BalanceAmount: zhios_order_relate_utils.Float64ToStr(afterAmount), |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
Uid: subsidyWithUser.Uid, |
|
|
|
Kind: subsidyWithUser.Kind, |
|
|
|
Month: zhios_order_relate_utils.StrToInt(now.Format("200601")), |
|
|
|
} |
|
|
|
insertAffected, err := db.SubsidyWithUserFlowInsert(session, subsidyWitUserFlow) |
|
|
|
if err != nil { |
|
|
@@ -218,8 +221,19 @@ func DealUserConsumeIntegral(session *xorm.Session, subsidyWithUser *model.Subsi |
|
|
|
if insertAffected <= 0 { |
|
|
|
return errors.New("新增 subsidy_with_user_flow 记录失败") |
|
|
|
} |
|
|
|
|
|
|
|
//3、给用户添加余额 |
|
|
|
//3、加入每月统计 |
|
|
|
if consumeIntegralValue > 0 { |
|
|
|
var subsidyWitUserMonth = &model.SubsidyWithUserMonth{ |
|
|
|
Uid: subsidyWithUser.Uid, |
|
|
|
ConsumeAmount: zhios_order_relate_utils.Float64ToStr(consumeIntegralValue), |
|
|
|
Date: now.Format("2006-01"), |
|
|
|
} |
|
|
|
_, err1 := db.SubsidyWithMonthInsert(session, subsidyWitUserMonth) |
|
|
|
if err1 != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
//4、给用户添加余额 |
|
|
|
orderType := enum.FinUserFlowOrderActionString(md.ConsumeSubsidyOrdActionForFinUserFlow) |
|
|
|
var dealUserAmount = md.DealUserAmount{ |
|
|
|
Kind: "add", |
|
|
@@ -282,9 +296,9 @@ func DealUserExperienceIntegral(session *xorm.Session, subsidyWithUser *model.Su |
|
|
|
//3、加入每月统计 |
|
|
|
if experienceIntegralValue > 0 { |
|
|
|
var subsidyWitUserMonth = &model.SubsidyWithUserMonth{ |
|
|
|
Uid: subsidyWithUser.Uid, |
|
|
|
Amount: zhios_order_relate_utils.Float64ToStr(experienceIntegralValue), |
|
|
|
Date: now.Format("2006-01"), |
|
|
|
Uid: subsidyWithUser.Uid, |
|
|
|
ExperienceAmount: zhios_order_relate_utils.Float64ToStr(experienceIntegralValue), |
|
|
|
Date: now.Format("2006-01"), |
|
|
|
} |
|
|
|
_, err1 := db.SubsidyWithMonthInsert(session, subsidyWitUserMonth) |
|
|
|
if err1 != nil { |
|
|
|