49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
| <?php
 | |
| 
 | |
| namespace app\model;
 | |
| 
 | |
| use Exception;
 | |
| use think\exception\ValidateException;
 | |
| 
 | |
| class Account extends Base
 | |
| {
 | |
| 
 | |
|     public const type_visitor       = -1;//游客
 | |
|     public const type_consumer      = 0;//普通用户
 | |
|     public const type_business      = 1;//商家
 | |
|     public const type_staff         = 2;//员工
 | |
| 
 | |
|     public const state_default         = 0;// 未提交
 | |
|     public const state_examineing      = 1 ;// 1审核中
 | |
|     public const state_fail            = 2;// 2拒绝
 | |
|     public const state_success         = 3;// 3审核通过
 | |
| 
 | |
|     // 默认头像
 | |
|     public const DEFAULT_AVATAR         = '/static/images/default-avatar.png';
 | |
| 
 | |
|     public static  function allState(){
 | |
|         return [
 | |
|             self::state_default=>"未提交",
 | |
|             self::state_examineing=>"审核中",
 | |
|             self::state_fail=>"拒绝",
 | |
|             self::state_success=>"审核通过",
 | |
|         ];
 | |
|     }
 | |
| 
 | |
|     public static function accountTypeDescList(): array
 | |
|     {
 | |
|         return [
 | |
|             (string) self::type_visitor     => '游客',
 | |
|             (string) self::type_consumer    => '普通用户',
 | |
|             (string) self::type_business    => '商家',
 | |
|             (string) self::type_staff       => '员工',
 | |
|         ];
 | |
|     }
 | |
| 
 | |
|     public function tag()
 | |
|     {
 | |
|         return $this->hasOne(Tag::class,"id","tag_id");
 | |
|     }
 | |
| 
 | |
| }
 |