fix: some api bug
This commit is contained in:
@@ -39,9 +39,8 @@ func (l *UpdateWalletsLogic) UpdateWallets(in *pb.UpdateWalletsReq) (*pb.UpdateW
|
||||
}
|
||||
|
||||
updater := tx.Wallet.Update().
|
||||
Where(wallet.UserIDEQ(in.UserId), wallet.VersionEQ(int(in.GetVersion()))).
|
||||
Where(wallet.IDEQ(in.UserId), wallet.VersionEQ(int(in.GetVersion()))).
|
||||
AddVersion(1)
|
||||
|
||||
if in.Balance != nil {
|
||||
parsedBalance, perr := decimal.NewFromString(in.GetBalance())
|
||||
if perr != nil {
|
||||
@@ -70,7 +69,7 @@ func (l *UpdateWalletsLogic) UpdateWallets(in *pb.UpdateWalletsReq) (*pb.UpdateW
|
||||
return nil, err
|
||||
}
|
||||
if affected == 0 {
|
||||
exist, qerr := tx.Wallet.Query().Where(wallet.UserIDEQ(in.UserId)).Exist(l.ctx)
|
||||
exist, qerr := tx.Wallet.Query().Where(wallet.IDEQ(in.UserId)).Exist(l.ctx)
|
||||
_ = tx.Rollback()
|
||||
if qerr != nil {
|
||||
return nil, qerr
|
||||
|
||||
Reference in New Issue
Block a user