Explorar el Código

更新

master
huangjiajun hace 7 meses
padre
commit
cb037204bf
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. +1
    -0
      db/model/subsidy_base.go
  2. +3
    -1
      rule/consume_integral_settlement.go

+ 1
- 0
db/model/subsidy_base.go Ver fichero

@@ -13,6 +13,7 @@ type SubsidyBase struct {
ExperienceIntegral string `json:"experience_integral" xorm:"default 0.00 comment('体验积分数量') DECIMAL(20,2)"`
ExperienceMoney string `json:"experience_money" xorm:"default 0.00 comment('体验补贴') DECIMAL(20,2)"`
ExperienceTotalMoney string `json:"experience_total_money" xorm:"default 0.00 comment('资金池 体验补贴(元)') DECIMAL(20,2)"`
StoreTotalMoney string `json:"store_total_money" xorm:"default 0.00 comment('资金池 体验补贴(元)') DECIMAL(20,2)"`
ConsumptionDay int `json:"consumption_day" xorm:"default 0 comment('消费补贴兑换后第X天') INT(11)"`
ExperienceDay int `json:"experience_day" xorm:"comment('体贴补贴兑换后第X天') VARCHAR(255)"`
SettleTime string `json:"settle_time" xorm:"comment('每天 XX:xx') VARCHAR(255)"`


+ 3
- 1
rule/consume_integral_settlement.go Ver fichero

@@ -208,10 +208,12 @@ func DailySettlementBlockConsumeIntegral(engine *xorm.Engine, mid string, isTask
//3、修改 subsidy_base 中 consumption_money、experience_money
consumeTotal, _ := consumeValueTotal.Float64()
experienceTotal, _ := experienceValueTotal.Float64()
storeTotal, _ := storeValueTotal.Float64()
subsidyBase.ConsumptionTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ConsumptionTotalMoney) - consumeTotal)
subsidyBase.ExperienceTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ExperienceTotalMoney) - experienceTotal)
subsidyBase.StoreTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.StoreTotalMoney) - storeTotal)
subsidyBase.SettlementDate = today
updateAffected, err := db.SubsidyBaseUpdate(session, subsidyBase.Id, subsidyBase, "consumption_total_money", "experience_total_money", "settlement_date")
updateAffected, err := db.SubsidyBaseUpdate(session, subsidyBase.Id, subsidyBase, "consumption_total_money", "store_total_money", "experience_total_money", "settlement_date")
if err != nil {
_ = session.Rollback()
return


Cargando…
Cancelar
Guardar