29 lines
576 B
PHP
29 lines
576 B
PHP
<?php
|
|
|
|
namespace app\model;
|
|
|
|
use think\Model;
|
|
|
|
class User extends Model
|
|
{
|
|
protected $name = 'users';
|
|
protected $autoWriteTimestamp = true;
|
|
protected $createTime = 'created_at';
|
|
protected $updateTime = 'updated_at';
|
|
|
|
public function membership()
|
|
{
|
|
return $this->belongsTo(MembershipLevel::class, 'membership_level_id');
|
|
}
|
|
|
|
public function roleModel()
|
|
{
|
|
return $this->belongsTo(Role::class, 'role_id');
|
|
}
|
|
|
|
public function department()
|
|
{
|
|
return $this->belongsTo(Department::class, 'department_id');
|
|
}
|
|
}
|