1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace app\common\Enum;
- /**
- * 申请状态枚举类
- */
- class ApplyStatus
- {
- // 申请状态常量
- const PENDING = 'pending';
- const APPROVED = 'approved';
- const REJECTED = 'rejected';
- /**
- * 获取所有申请状态
- * @return array
- */
- public static function getAll()
- {
- return [
- self::PENDING => '待审核',
- self::APPROVED => '已通过',
- self::REJECTED => '已拒绝'
- ];
- }
- /**
- * 获取申请状态描述
- * @param string $status
- * @return string
- */
- public static function getStatusText($status)
- {
- $statuses = self::getAll();
- return isset($statuses[$status]) ? $statuses[$status] : '待审核';
- }
- }
|