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

58 lines
1.3 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 text()
{
return match ($this) {
static::None => '普通用户',
static::Gold => '金牌经销商',
static::Special => '特邀经销商',
static::Contracted => '签约经销商',
static::Secondary => '二级经销商',
static::Top => '一级经销商',
};
}
/**
* @return string
*/
public static function texts(): array
{
return [
static::None->value => '普通用户',
static::Gold->value => '金牌经销商',
static::Special->value => '特邀经销商',
static::Contracted->value => '签约经销商',
static::Secondary->value => '二级经销商',
static::Top->value => '一级经销商',
];
}
}