42 lines
797 B
PHP
42 lines
797 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum WalletToBankLogStatus: int {
|
|
case Pending = 0;
|
|
case Completed = 1;
|
|
case Refused = 2;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function color(): string
|
|
{
|
|
return match ($this) {
|
|
static::Pending => '#5b69bc',
|
|
static::Completed => '#21b978',
|
|
static::Refused => '#b3b9bf',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function text(): string
|
|
{
|
|
return static::texts()[$this->value];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public static function texts(): array
|
|
{
|
|
return [
|
|
static::Pending->value => '待处理',
|
|
static::Completed->value => '已完成',
|
|
static::Refused->value => '已拒绝',
|
|
];
|
|
}
|
|
}
|