You've already forked think-plugs-staff
[staff]关联系统用户
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
namespace jerryyan\staff\model;
|
namespace jerryyan\staff\model;
|
||||||
|
|
||||||
use think\admin\Model;
|
use think\admin\Model;
|
||||||
|
use think\admin\model\SystemUser;
|
||||||
use think\db\Query;
|
use think\db\Query;
|
||||||
use think\model\relation\HasOne;
|
use think\model\relation\HasOne;
|
||||||
|
|
||||||
@ -24,6 +25,11 @@ class StaffUser extends Model
|
|||||||
$query->where('is_deleted', '=', 0);
|
$query->where('is_deleted', '=', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sysUser(): HasOne
|
||||||
|
{
|
||||||
|
return $this->hasOne(SystemUser::class, 'id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
public function dept(): HasOne
|
public function dept(): HasOne
|
||||||
{
|
{
|
||||||
return $this->hasOne(StaffDept::class, 'id', 'dept_id')->where([
|
return $this->hasOne(StaffDept::class, 'id', 'dept_id')->where([
|
||||||
|
Reference in New Issue
Block a user