初始化项目
This commit is contained in:
55
app/Models/YiiModels/User.php
Normal file
55
app/Models/YiiModels/User.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\YiiModels;
|
||||
|
||||
use App\Models\Cart;
|
||||
use App\Models\Extend\SoftDeletesInt;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\YiiModels\User
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $openid
|
||||
* @property string $session_key
|
||||
* @property string $unionid
|
||||
* @property string $mobile 手机号
|
||||
* @property string $password 密码
|
||||
* @property string $nickname 昵称
|
||||
* @property int $gender 性别,值为1时是男性,值为2时是女性,值为0时是未知
|
||||
* @property string $country 国家
|
||||
* @property string $province 省份
|
||||
* @property string $city 城市
|
||||
* @property string $avatarurl 头像
|
||||
* @property string $token
|
||||
* @property string $idcard 身份证号
|
||||
* @property int $sex 性别0默认1男2女
|
||||
* @property int|null $age 年龄
|
||||
* @property int $status 身份状态 0待激活待完善,1待审核,2已认证,3已拒绝
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property int $is_delete 是否删除0否
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Cart[] $carts 购物车
|
||||
* @property-read int|null $carts_count
|
||||
* @property-read string $created_at_format 创建时间的格式化
|
||||
* @property-read string $updated_at_format 更新时间的格式化
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\User newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\User newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\User query()
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class User extends YiiBaseAuthModel
|
||||
{
|
||||
use SoftDeletesInt;
|
||||
|
||||
const GUARD = 'member';
|
||||
|
||||
/**
|
||||
* @comment 购物车
|
||||
* @return HasMany
|
||||
*/
|
||||
public function carts(): HasMany
|
||||
{
|
||||
return $this->hasMany(Cart::class, 'user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user