store-manage/app/Enums/SignStatus.php

43 lines
912 B
PHP

<?php
namespace App\Enums;
enum SignStatus: int
{
case Normal = 1;
case Lose = 2;
case Absent = 3;
public static function options()
{
return [
self::Normal->value => '正常',
self::Lose->value => '缺卡',
self::Absent->value => '旷工',
];
}
public static function source()
{
return [
self::Normal->value => [
'label' => self::Normal->text(),
'color' => '#1b9908',
],
self::Lose->value => [
'label' => self::Lose->text(),
'color' => '#d97116',
],
self::Absent->value => [
'label' => self::Absent->text(),
'color' => '#a61922',
],
];
}
public function text()
{
return data_get(self::options(), $this->value);
}
}