refactor: 修改model
This commit is contained in:
@@ -3,38 +3,16 @@ declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model\v1;
|
||||
|
||||
use think\Model;
|
||||
use app\common\model\UserBaseModel;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class UserModel extends Model
|
||||
class UserModel extends UserBaseModel
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'sys_user';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 隐藏字段
|
||||
protected $hidden = ['password', 'salt'];
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'username' => 'string',
|
||||
'password' => 'string',
|
||||
'salt' => 'string',
|
||||
'role_id' => 'int',
|
||||
'nickname' => 'string',
|
||||
'avatar' => 'string',
|
||||
'mobile' => 'string',
|
||||
'email' => 'string',
|
||||
'status' => 'int',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
] ;
|
||||
|
||||
// 用户名查询范围
|
||||
public function scopeUsernameOrMobile($query, $username)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user