This commit is contained in:
baodev0
2026-09-23 15:17:18 +07:00
parent cd38c5d6d0
commit 82a71244ca
107 changed files with 3332 additions and 3306 deletions
+5 -7
View File
@@ -58,15 +58,13 @@ class Order extends Model
// Helpers
// -------------------------------------------------------------------------
/**
* orders.status là tinyInteger (OrderStatus), không phải chuỗi — bản cũ match 'pending'/
* 'completed'… nên mọi giá trị đều rơi vào default và hiển thị ra "0", "1", "2".
*/
public function getStatusLabelAttribute(): string
{
return match ($this->status) {
'pending' => 'Chờ xử lý',
'processing' => 'Đang xử lý',
'completed' => 'Hoàn tất',
'cancelled' => 'Đã hủy',
default => ucfirst($this->status),
};
return \App\Enums\Order\OrderStatus::tryFrom((int) $this->status)?->label() ?? 'Không xác định';
}
public function payment()