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