6
0
Fork 0
jiqu-library-server/app/Enums/DealerLvl.php

70 lines
1.7 KiB
PHP

<?php
namespace App\Enums;
enum DealerLvl: int {
case None = 0;
case Gold = 2;
case Special = 3;
case Contracted = 4;
case Secondary = 5;
case Top = 6;
/**
* 代理等级
*/
public function agentLvl()
{
return match ($this) {
static::None => 0,
static::Gold => 2,
static::Special => 3,
static::Contracted => 4,
static::Secondary => 5,
static::Top => 6,
};
}
/**
* @return string
*/
public function icon()
{
return match ($this) {
static::Secondary => 'https://cdn.zichunsheng.cn/statics/icons/dealer_lvl_5.png',
static::Top => 'https://cdn.zichunsheng.cn/statics/icons/dealer_lvl_6.png',
default => '',
};
}
/**
* @return string
*/
public function text()
{
return match ($this) {
static::None => '普通用户',
static::Gold => '金牌经销商',
static::Special => '特邀经销商',
static::Contracted => '签约经销商',
static::Secondary => '签约经销商II',
static::Top => '签约经销商I',
};
}
/**
* @return string
*/
public static function texts(): array
{
return [
static::None->value => '普通用户',
static::Gold->value => '金牌经销商',
static::Special->value => '特邀经销商',
static::Contracted->value => '签约经销商',
static::Secondary->value => '签约经销商II',
static::Top->value => '签约经销商I',
];
}
}