|
|
@@ -207,11 +207,8 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str |
|
|
|
} |
|
|
|
for _, user := range users { |
|
|
|
//查询当前用户今日的积分释放值 |
|
|
|
var integralReleaseUserWithOrdFlow model.IntegralReleaseUserWithOrdFlow |
|
|
|
has, err := session.Where("uid =? and release_date =?", user.Uid, today).And("release_green_coin_num > 0").Desc("id").Get(&integralReleaseUserWithOrdFlow) |
|
|
|
if has == false { |
|
|
|
continue |
|
|
|
} |
|
|
|
var integralReleaseUserWithOrdFlows []model.IntegralReleaseUserWithOrdFlow |
|
|
|
err := session.Where("uid =? and release_date =?", user.Uid, 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, |
|
|
@@ -219,21 +216,23 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str |
|
|
|
"err": err, |
|
|
|
})) |
|
|
|
} |
|
|
|
if zhios_order_relate_utils.StrToFloat64(integralReleaseUserWithOrdFlow.ReleaseGreenCoinNum) <= 0 { |
|
|
|
if len(integralReleaseUserWithOrdFlows) == 0 { |
|
|
|
continue |
|
|
|
} |
|
|
|
//发放服务收益 |
|
|
|
err = DealIntegralReleaseInterpositionUserAmount(session, md.DealIntegralReleaseInterpositionUserAmountReq{ |
|
|
|
Kind: "sub", |
|
|
|
Mid: mid, |
|
|
|
OrdId: "", |
|
|
|
CoinId: user.CoinId, |
|
|
|
Uid: user.Uid, |
|
|
|
Amount: zhios_order_relate_utils.StrToFloat64(integralReleaseUserWithOrdFlow.ReleaseGreenCoinNum), |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
_ = session.Rollback() |
|
|
|
return err |
|
|
|
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), |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
_ = session.Rollback() |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|