Compare commits

..

2 Commits

Author SHA1 Message Date
4b0484bb03 [staff]关联系统用户 2025-06-24 15:10:28 +08:00
4aaedc645c [staff]数据库迁移脚本 2025-06-24 09:48:26 +08:00
2 changed files with 6 additions and 0 deletions

View File

@ -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([