generated from liutk/owl-admin-base
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum CheckStatus: int
|
|
{
|
|
case None = 0;
|
|
case Processing = 1;
|
|
case Success = 2;
|
|
case Fail = 3;
|
|
case Cancel = 4;
|
|
|
|
public static function options(): array
|
|
{
|
|
return [
|
|
self::None->value => '未审核',
|
|
self::Processing->value => '审核中',
|
|
self::Success->value => '审核通过',
|
|
self::Fail->value => '审核不通过',
|
|
self::Cancel->value => '已取消',
|
|
];
|
|
}
|
|
|
|
public function text()
|
|
{
|
|
return data_get(self::options(), $this->value);
|
|
}
|
|
|
|
public static function coplorMap()
|
|
{
|
|
// 'active' | 'inactive' | 'error' | 'success' | 'processing' | 'warning' |
|
|
return [
|
|
self::None->value => 'active',
|
|
self::Processing->value => 'processing',
|
|
self::Success->value => 'success',
|
|
self::Fail->value => 'error',
|
|
self::Cancel->value => 'inactive',
|
|
];
|
|
}
|
|
|
|
public function color()
|
|
{
|
|
return data_get(self::coplorMap(), $this->value);
|
|
}
|
|
}
|