data_center/app/common/model/user/User.php

24 lines
562 B
PHP

<?php
namespace app\common\model\user;
use app\common\model\BaseModel;
class User extends BaseModel
{
protected $name = 'user';
// 获取用户状态
public function getUserStatusTextAttr($value,$data): string
{
$user_status = [0=>'正常',1=>'冻结',2=>'删除'];
return $user_status[$data['user_status']];
}
// 获取用户性别
public function getUserGenderTextAttr($value,$data): string
{
$user_gender = [0=>'男',1=>'女',2=>'未知'];
return $user_gender[$data['user_gender']];
}
}