Ver a proveniência

update 中基积分

tags/v4.1.6
DengBiao há 2 anos
ascendente
cometimento
626a536a34
3 ficheiros alterados com 21 adições e 17 eliminações
  1. +1
    -0
      db/model/integral_release_interposition_user_amount.go
  2. +7
    -6
      md/fin_user_flow.go
  3. +13
    -11
      rule/integral_release_settlement.go

+ 1
- 0
db/model/integral_release_interposition_user_amount.go Ver ficheiro

@@ -7,6 +7,7 @@ import (
type IntegralReleaseInterpositionUserAmount struct {
Id int `json:"id" xorm:"not null pk autoincr comment('主键id') INT(11)"`
Uid int `json:"uid" xorm:"not null default 0 comment('用户uid') INT(11)"`
OriginalUid int `json:"original_uid" xorm:"not null default 0 comment('原始用户uid') INT(11)"`
CoinId int `json:"coin_id" xorm:"not null default 0 comment('虚拟币id(若为0则为 余额)') INT(11)"`
TotalAmount string `json:"total_amount" xorm:"not null default 0.0000 comment('累计金额') DECIMAL(10,4)"`
WaiteAmount string `json:"waite_amount" xorm:"not null default 0.0000 comment('待释放金额') DECIMAL(10,4)"`


+ 7
- 6
md/fin_user_flow.go Ver ficheiro

@@ -24,12 +24,13 @@ const DealUserAmountRequestIdPrefix = "%s:deal_user_amount:%d"
const UserAmountRedisKey = "%s:user_amount:%d"

type DealIntegralReleaseInterpositionUserAmountReq struct {
Kind string `json:"kind"`
Mid string `json:"mid"`
OrdId string `json:"ord_id"`
CoinId int `json:"coin_id"`
Uid int `json:"uid"`
Amount float64 `json:"amount"`
Kind string `json:"kind"`
Mid string `json:"mid"`
OrdId string `json:"ord_id"`
CoinId int `json:"coin_id"`
Uid int `json:"uid"`
OriginalUid int `json:"original_uid"`
Amount float64 `json:"amount"`
}

type DealUserAmount struct {


+ 13
- 11
rule/integral_release_settlement.go Ver ficheiro

@@ -208,7 +208,7 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str
for _, user := range users {
//查询当前用户今日的积分释放值
var integralReleaseUserWithOrdFlows []model.IntegralReleaseUserWithOrdFlow
err := session.Where("uid =? and release_date =?", user.Uid, today).And("release_green_coin_num > 0").Find(&integralReleaseUserWithOrdFlows)
err := session.Where("uid =? and release_date =?", user.OriginalUid, today).And("release_green_coin_num > 0").Find(&integralReleaseUserWithOrdFlows)
if err != nil {
zhios_order_relate_utils.FilePutContents("find_integral_release_user_with_ord_flow_err", zhios_order_relate_utils.SerializeStr(map[string]interface{}{
"uid": user.Uid,
@@ -222,12 +222,13 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str
for _, integralReleaseUserWithOrdFlow := range integralReleaseUserWithOrdFlows {
//发放服务收益
err = DealIntegralReleaseInterpositionUserAmount(session, md.DealIntegralReleaseInterpositionUserAmountReq{
Kind: "sub",
Mid: mid,
OrdId: "",
CoinId: 0, //TODO::直接写死为0,返现金
Uid: user.Uid, //TODO::待替换成间推用户uid
Amount: zhios_order_relate_utils.StrToFloat64(integralReleaseUserWithOrdFlow.ReleaseGreenCoinNum),
Kind: "sub",
Mid: mid,
OrdId: "",
CoinId: 0, //TODO::直接写死为0,返现金
Uid: user.Uid, //TODO::替换成间推用户uid
OriginalUid: user.OriginalUid,
Amount: zhios_order_relate_utils.StrToFloat64(integralReleaseUserWithOrdFlow.ReleaseGreenCoinNum),
})
if err != nil {
_ = session.Rollback()
@@ -432,10 +433,11 @@ func DealIntegralReleaseInterpositionUserAmount(session *xorm.Session, req md.De
})
if err != nil && err.Error() == "not found" {
userAmount = &model.IntegralReleaseInterpositionUserAmount{
Uid: req.Uid,
CoinId: req.CoinId,
CreateAt: now,
UpdateAt: now,
Uid: req.Uid,
OriginalUid: req.OriginalUid,
CoinId: req.CoinId,
CreateAt: now,
UpdateAt: now,
}
_, err = db.IntegralReleaseInterpositionUserAmountInsert(session, userAmount)
}


Carregando…
Cancelar
Guardar