'审核中', self::EVALUATE_STATUS_APPROVED => '审核通过', self::EVALUATE_STATUS_REJECTED => '审核失败' ]; return isset($statusMap[$status]) ? $statusMap[$status] : '未知状态'; } /** * 获取显示状态文本 * @param string $status * @return string */ public static function getStatusText($status) { $statusMap = [ self::STATUS_NORMAL => '正常显示', self::STATUS_HIDDEN => '隐藏' ]; return isset($statusMap[$status]) ? $statusMap[$status] : '未知状态'; } /** * 获取有图片状态文本 * @param int $hasPicture * @return string */ public static function getHasPictureText($hasPicture) { $statusMap = [ self::HAS_PICTURE_NO => '无图片', self::HAS_PICTURE_YES => '有图片' ]; return isset($statusMap[$hasPicture]) ? $statusMap[$hasPicture] : '未知状态'; } /** * 获取所有评价状态 * @return array */ public static function getEvaluateStatusList() { return [ self::EVALUATE_STATUS_PENDING => '审核中', self::EVALUATE_STATUS_APPROVED => '审核通过', self::EVALUATE_STATUS_REJECTED => '审核失败' ]; } /** * 获取所有显示状态 * @return array */ public static function getStatusList() { return [ self::STATUS_NORMAL => '正常显示', self::STATUS_HIDDEN => '隐藏' ]; } /** * 获取所有有图片状态 * @return array */ public static function getHasPictureList() { return [ self::HAS_PICTURE_NO => '无图片', self::HAS_PICTURE_YES => '有图片' ]; } /** * 验证评价状态 * @param int $status * @return bool */ public static function isValidEvaluateStatus($status) { return in_array($status, [ self::EVALUATE_STATUS_PENDING, self::EVALUATE_STATUS_APPROVED, self::EVALUATE_STATUS_REJECTED ]); } /** * 验证显示状态 * @param string $status * @return bool */ public static function isValidStatus($status) { return in_array($status, [ self::STATUS_NORMAL, self::STATUS_HIDDEN ]); } /** * 验证有图片状态 * @param int $hasPicture * @return bool */ public static function isValidHasPicture($hasPicture) { return in_array($hasPicture, [ self::HAS_PICTURE_NO, self::HAS_PICTURE_YES ]); } }