32 lines
574 B
PHP
32 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum OrderStatus: int
|
|
{
|
|
case None = 0;
|
|
case Success = 1;
|
|
|
|
public static function map()
|
|
{
|
|
return [
|
|
self::None->value => '未收',
|
|
self::Success->value => '已收',
|
|
];
|
|
}
|
|
|
|
public static function options()
|
|
{
|
|
$list = [];
|
|
foreach (static::map() as $key => $value) {
|
|
array_push($list, ['label' => $value, 'value' => $key]);
|
|
}
|
|
return $list;
|
|
}
|
|
|
|
public function text()
|
|
{
|
|
return data_get(self::map(), $this->value);
|
|
}
|
|
}
|