quanwei
2025-11-03 ef5d748e3e3331bd20d4065c33e7867c2637d1db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
 
namespace app\common\model\admin;
 
 
use app\common\model\BaseModel;
 
/**
 * 应用模型
 */
class Role extends BaseModel
{
    protected $name = 'dledition_role';
    protected $pk = 'role_id';
 
    /**
     * 关联权限
     * @return \think\model\relation\HasMany
     */
    public function access()
    {
        return $this->hasMany('RoleAccess', 'role_id', 'role_id');
    }
 
    /**
     * 获取详情
     */
    public static function detail($role_id)
    {
        return (new static())->with(['access'])->find($role_id);
    }
 
}