Admin.php 1.1 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------------------------------
  4. * GouGuOPEN [ 左手研发,右手开源,未来可期!]
  5. +-----------------------------------------------------------------------------------------------
  6. * @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
  7. +-----------------------------------------------------------------------------------------------
  8. * @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
  9. +-----------------------------------------------------------------------------------------------
  10. * @Author 勾股工作室 <hdm58@qq.com>
  11. +-----------------------------------------------------------------------------------------------
  12. */
  13. namespace app\user\model;
  14. use think\Model;
  15. class Admin extends Model
  16. {
  17. public function position()
  18. {
  19. return $this->hasOne(Position::class);
  20. }
  21. // 定义与部门的多对多关联关系
  22. public function departments()
  23. {
  24. return $this->belongsToMany(Department::class, 'department_admin');
  25. }
  26. }