+----------------------------------------------------------------------------------------------- */ namespace app\user\model; use think\Model; class Admin extends Model { public function position() { return $this->hasOne(Position::class); } // 定义与部门的多对多关联关系 public function departments() { return $this->belongsToMany(Department::class, 'department_admin'); } }