[staff]关联系统用户

This commit is contained in:
2025-06-24 15:10:28 +08:00
parent 4aaedc645c
commit 4b0484bb03

View File

@ -3,6 +3,7 @@
namespace jerryyan\staff\model;
use think\admin\Model;
use think\admin\model\SystemUser;
use think\db\Query;
use think\model\relation\HasOne;
@ -24,6 +25,11 @@ class StaffUser extends Model
$query->where('is_deleted', '=', 0);
}
public function sysUser(): HasOne
{
return $this->hasOne(SystemUser::class, 'id', 'id');
}
public function dept(): HasOne
{
return $this->hasOne(StaffDept::class, 'id', 'dept_id')->where([