小程序用户
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Member\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MemberUserModel extends Model
|
||||
{
|
||||
protected $table = 'user';
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $fillable = [
|
||||
'username',
|
||||
'password',
|
||||
'nickname',
|
||||
'email',
|
||||
'avatar',
|
||||
'mobile',
|
||||
'gender',
|
||||
'birthday',
|
||||
'balance',
|
||||
'status',
|
||||
'last_login_at',
|
||||
'openid',
|
||||
'unionid',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'last_login_at' => 'datetime',
|
||||
'birthday' => 'date',
|
||||
'gender' => 'integer',
|
||||
'status' => 'integer',
|
||||
'balance' => 'decimal:2',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Member\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class UserAddressModel extends Model
|
||||
{
|
||||
protected $table = 'user_addresses';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'name',
|
||||
'mobile',
|
||||
'province',
|
||||
'city',
|
||||
'district',
|
||||
'detail',
|
||||
'is_default',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_default' => 'integer',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(MemberUserModel::class, 'user_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user