Role.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\common\model\store;
  13. use app\common\model\BaseModel;
  14. /**
  15. * 商家用户角色模型
  16. * Class Role
  17. * @package app\common\model\admin
  18. */
  19. class Role extends BaseModel
  20. {
  21. // 定义表名
  22. protected $name = 'store_role';
  23. // 定义主键
  24. protected $pk = 'role_id';
  25. /**
  26. * 关联操作权限
  27. * @return \think\model\relation\HasMany
  28. */
  29. public function roleMenu()
  30. {
  31. return $this->hasMany('RoleMenu', 'role_id');
  32. }
  33. /**
  34. * 角色信息
  35. * @param $where
  36. * @return array|null|static
  37. */
  38. public static function detail($where)
  39. {
  40. return static::get($where);
  41. }
  42. }