fix(purchase): update gift amount deduction logic and handle zero-amount order status
This commit is contained in:
committed by
Leif Draven
parent
59348c1643
commit
40c24fbc85
@@ -82,7 +82,7 @@ func (l *CloseOrderLogic) CloseOrder(req *types.CloseOrderRequest) error {
|
||||
return err
|
||||
}
|
||||
deduction := userInfo.GiftAmount + orderInfo.GiftAmount
|
||||
err = tx.Model(&user.User{}).Where("id = ?", orderInfo.UserId).Update("deduction", deduction).Error
|
||||
err = tx.Model(&user.User{}).Where("id = ?", orderInfo.UserId).Update("gift_amount", deduction).Error
|
||||
if err != nil {
|
||||
l.Errorw("[CloseOrder] Refund deduction amount failed",
|
||||
logger.Field("error", err.Error()),
|
||||
|
||||
Reference in New Issue
Block a user