where('type',$type)->value('menu_id'); // dd($client_id,$clientRoute); if (empty($client_id)) { $client_info = MenuUrl::create([ 'url_name' => '', 'url' => $clientRoute, 'menu_id' => 0, 'status' => 0, 'type' => $type, ]); $client_id = $client_info->{'id'}; } $cache_name = 'role_url_ids' . $role_id; $url_ids=RedisDataServer::creatServer()->getData($cache_name,'json'); if(empty($url_ids)){ $permission_ids = Role::where('id', $role_id)->value('permission_ids'); $url_ids = explode(',', $permission_ids); RedisDataServer::creatServer()->setData($cache_name,$url_ids,'json',30); } if (empty($url_ids) || !in_array($client_id, $url_ids)) { return false; } return true; } }