quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
 
namespace app\shop\model\plus\operations;
 
use app\common\model\plus\operations\RoleAccess as RoleAccessModel;
 
/**
 * 区域代理角色权限关系模型
 */
class RoleAccess extends RoleAccessModel
{
    /**
     * 获取指定角色的所有权限id
     * @param int|array $role_id 角色id (支持数组)
     */
    public static function getAccessIds($role_id)
    {
        $roleIds = is_array($role_id) ? $role_id : [(int)$role_id];
        return (new self)->where('role_id', 'in', $roleIds)->column('access_id');
    }
}