diff --git a/db/db_integral_release_interposition_user_amount.go b/db/db_integral_release_interposition_user_amount.go index 910e72f..dd16ce1 100644 --- a/db/db_integral_release_interposition_user_amount.go +++ b/db/db_integral_release_interposition_user_amount.go @@ -83,7 +83,7 @@ func IntegralReleaseInterpositionUserAmountGetOneByParams(session *xorm.Session, return nil, zhios_order_relate_logx.Error(err) } if has == false { - return nil, errors.New("未查询到相应的 integral_release_interposition_user_amount 记录") + return nil, errors.New("not found") } return &m, nil } diff --git a/rule/integral_release_settlement.go b/rule/integral_release_settlement.go index 48fd1c4..f57b341 100644 --- a/rule/integral_release_settlement.go +++ b/rule/integral_release_settlement.go @@ -282,9 +282,19 @@ func DealIntegralReleaseInterpositionUserAmount(session *xorm.Session, req md.De "key": "uid", "value": req.Uid, }) + if err != nil && err.Error() == "not found" { + userAmount = &model.IntegralReleaseInterpositionUserAmount{ + Uid: req.Uid, + CoinId: req.CoinId, + CreateAt: now, + UpdateAt: now, + } + _, err = db.IntegralReleaseInterpositionUserAmountInsert(session, userAmount) + } if err != nil { return err } + totalAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount.TotalAmount)) waiteAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount.WaiteAmount)) alreadyAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount.AlreadyAmount))