集中订单状态常量
This commit is contained in:
@@ -102,7 +102,7 @@ func pendingPaymentTimeoutMinutes(tx *gorm.DB) int {
|
||||
}
|
||||
|
||||
func applyPaymentDeadline(dto *OrderDTO, order model.RentalOrder, timeoutMinutes int) {
|
||||
if dto == nil || order.Status != "pending_payment" || timeoutMinutes <= 0 {
|
||||
if dto == nil || order.Status != orderStatusPendingPayment || timeoutMinutes <= 0 {
|
||||
return
|
||||
}
|
||||
deadline := order.CreatedAt.Add(time.Duration(timeoutMinutes) * time.Minute)
|
||||
@@ -120,7 +120,7 @@ func (r *Repository) latestCheckoutAdminDTO(orderID uint64) *CheckoutDTO {
|
||||
|
||||
func shouldAttachCheckout(status string) bool {
|
||||
switch status {
|
||||
case "pending_checkout_confirm", "pending_checkout_accept", "checkout_disputing", "completed":
|
||||
case orderStatusPendingCheckoutConfirm, orderStatusPendingCheckoutAccept, orderStatusCheckoutDisputing, orderStatusCompleted:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user