feat: integrate unified payment and wallet refunds
This commit is contained in:
@@ -371,8 +371,8 @@ func AdjustOrderAmount(ctx *gin.Context) {
|
||||
}
|
||||
var paymentCount int64
|
||||
if err := tx.Model(&models.GasorderPayment{}).
|
||||
Joins("JOIN wallet_payment ON wallet_payment.id = gasorder_payment.wallet_payment_id").
|
||||
Where("gasorder_payment.gasorder_basic_id = ? AND wallet_payment.payment_status = ?", order.ID, common.StatusPaid).
|
||||
Joins("JOIN payment_order ON payment_order.id = gasorder_payment.payment_order_id").
|
||||
Where("gasorder_payment.gasorder_basic_id = ? AND payment_order.payment_status = ?", order.ID, 23).
|
||||
Count(&paymentCount).Error; err != nil || paymentCount > 0 {
|
||||
return errors.New("paid order cannot be adjusted")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user