30 lines
586 B
PHP
30 lines
586 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum DealerManageSubsidyStatus: int {
|
|
case Pending = 0;
|
|
case Completed = 5;
|
|
|
|
public function color(): string
|
|
{
|
|
return match ($this) {
|
|
static::Pending => '#5b69bc',
|
|
static::Completed => '#21b978',
|
|
};
|
|
}
|
|
|
|
public function text(): string
|
|
{
|
|
return static::texts()[$this->value] ?? 'Unknown';
|
|
}
|
|
|
|
public static function texts(): array
|
|
{
|
|
return [
|
|
static::Pending->value => '待付款',
|
|
static::Completed->value => '已付款',
|
|
];
|
|
}
|
|
}
|