多笔立减

This commit is contained in:
ziming 2025-08-12 15:58:45 +08:00
parent 4b17fbd9bf
commit 1c52f0adc6
1 changed files with 8 additions and 0 deletions

View File

@ -329,6 +329,10 @@ func (p *OrderRepoImpl) Success(ctx context.Context, id uint64, voucherNo string
return fmt.Errorf("update db fail %w", tx.Error)
}
if tx.RowsAffected == 0 {
return fmt.Errorf("no rows affected")
}
return nil
}
@ -378,6 +382,10 @@ func (p *OrderRepoImpl) Fail(ctx context.Context, id uint64, remark string) erro
return fmt.Errorf("update db fail %w", tx.Error)
}
if tx.RowsAffected == 0 {
return fmt.Errorf("no rows affected")
}
return nil
}