'是', self::NO => '否', ]; } /** * 获取状态描述 * @param int $status * @return string */ public static function getStatusText($status) { $map = [ self::ENABLED => '开启', self::DISABLED => '关闭', ]; return $map[$status] ?? '未知'; } /** * 获取状态映射 * @return array */ public static function getMap() { return [ self::ENABLED => '开启', self::DISABLED => '关闭', ]; } const NORMAL = 'normal'; // 正常 const HIDDEN = 'hidden'; // 隐藏 /** * 获取状态描述 * @param int $status * @return string */ public static function getStrStatusText($status) { $map = [ self::NORMAL => '正常', self::HIDDEN => '隐藏', ]; return $map[$status] ?? '未知'; } /** * 获取状态映射 * @return array */ public static function getStrMap() { return [ self::NORMAL => '正常', self::HIDDEN => '隐藏', ]; } }