SystemRole.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\common\model\auth;
  15. use app\common\model\BaseModel;
  16. use think\model\concern\SoftDelete;
  17. /**
  18. * 角色模型
  19. * Class Role
  20. * @package app\common\model
  21. */
  22. class SystemRole extends BaseModel
  23. {
  24. use SoftDelete;
  25. protected $deleteTime = 'delete_time';
  26. protected $name = 'system_role';
  27. /**
  28. * @notes 角色与菜单关联关系
  29. * @return \think\model\relation\HasMany
  30. * @author 段誉
  31. * @date 2022/7/6 11:16
  32. */
  33. public function roleMenuIndex()
  34. {
  35. return $this->hasMany(SystemRoleMenu::class, 'role_id');
  36. }
  37. }