Merge branch 'feat-IRONFANS-70' into test

This commit is contained in:
lwl0608 2024-04-16 22:09:28 +08:00
commit bc72a80687
1 changed files with 5 additions and 9 deletions

View File

@ -492,19 +492,15 @@ func (v *Vas) calcAndUpdateIncome(ctx *gin.Context, tx *sqlx.Tx, streamerMid, ui
} }
logger.Info("incomeList: %v", util.ToJson(list)) logger.Info("incomeList: %v", util.ToJson(list))
// 检查所有人钱包
for _, ii := range list {
_, exists := v.CheckWalletExist(ctx, tx, ii.Mid)
if !exists {
err = errs.ErrVasWalletNotExist
return make([]IncomeInfo, 0), err
}
}
// 写记录 // 写记录
for _, ii := range list { for _, ii := range list {
// 写消费记录 // 写消费记录
wallet, _ := v.CheckWalletExist(ctx, tx, ii.Mid) wallet, _ := v.CheckWalletExist(ctx, tx, ii.Mid)
if wallet == nil {
logger.Error("CheckWalletExist fail, mid: %v", ii.Mid)
err = errs.ErrVasWalletNotExist
return make([]IncomeInfo, 0), err
}
ch := &dbstruct.ConsumeHistory{ ch := &dbstruct.ConsumeHistory{
Mid: goproto.Int64(ii.Mid), Mid: goproto.Int64(ii.Mid),
Uid: goproto.Int64(uid), Uid: goproto.Int64(uid),