2020-11-04 16:47:17 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare (strict_types=1);
|
2020-11-14 18:10:28 +08:00
|
|
|
|
2020-11-04 16:47:17 +08:00
|
|
|
namespace App\Model;
|
|
|
|
|
2021-05-23 16:52:01 +08:00
|
|
|
use Qbhy\HyperfAuth\AuthAbility;
|
|
|
|
use Qbhy\HyperfAuth\Authenticatable;
|
|
|
|
|
2020-11-04 16:47:17 +08:00
|
|
|
/**
|
|
|
|
* Class User
|
|
|
|
*
|
2021-04-20 16:30:57 +08:00
|
|
|
* @property integer $id 用户ID
|
|
|
|
* @property string $nickname 用户昵称
|
|
|
|
* @property string $mobile 登录手机号
|
2021-04-22 16:54:01 +08:00
|
|
|
* @property string $email 邮箱地址
|
2021-04-20 16:30:57 +08:00
|
|
|
* @property string $password 登录密码
|
|
|
|
* @property string $avatar 头像
|
|
|
|
* @property integer $gender 性别
|
2021-04-22 16:54:01 +08:00
|
|
|
* @property string $motto 座右铭
|
2021-07-05 21:52:44 +08:00
|
|
|
* @property string $is_robot 是否机器人
|
|
|
|
* @property string $created_at 注册时间
|
|
|
|
* @property string $updated_at 更新时间
|
2020-11-04 16:47:17 +08:00
|
|
|
* @package App\Model
|
|
|
|
*/
|
2021-05-23 16:52:01 +08:00
|
|
|
class User extends BaseModel implements Authenticatable
|
2020-11-04 16:47:17 +08:00
|
|
|
{
|
2021-05-23 16:52:01 +08:00
|
|
|
use AuthAbility;
|
|
|
|
|
2020-11-04 16:47:17 +08:00
|
|
|
protected $table = 'users';
|
|
|
|
|
2021-07-12 22:31:37 +08:00
|
|
|
public $timestamps = true;
|
|
|
|
|
2020-11-04 22:58:49 +08:00
|
|
|
protected $fillable = [
|
2021-04-22 16:14:34 +08:00
|
|
|
'mobile',
|
|
|
|
'nickname',
|
|
|
|
'avatar',
|
|
|
|
'gender',
|
|
|
|
'password',
|
|
|
|
'motto',
|
|
|
|
'email',
|
2021-07-05 21:52:44 +08:00
|
|
|
'is_robot',
|
|
|
|
'created_at',
|
|
|
|
'updated_at',
|
2020-11-04 22:58:49 +08:00
|
|
|
];
|
2020-11-04 16:47:17 +08:00
|
|
|
|
2021-07-12 22:00:48 +08:00
|
|
|
protected $casts = [
|
|
|
|
'gender' => 'integer',
|
|
|
|
'is_robot' => 'integer',
|
|
|
|
];
|
2021-05-23 16:52:01 +08:00
|
|
|
|
|
|
|
protected $hidden = [
|
|
|
|
'password'
|
|
|
|
];
|
2020-11-04 16:47:17 +08:00
|
|
|
}
|