Skip to content

Commit

Permalink
getSubscribes private channel
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Jul 21, 2021
1 parent 8d09794 commit 6e0f550
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/Api/WebSocket/SocketClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,26 @@ protected function getData($global,$callback=null,$sub=[]){

$global_local=$global->get('global_local');
$temp=[];
//print_r($all_sub);die;

//默认返回所有数据
if(empty($sub)){
foreach ($all_sub as $k=>$v){
if(is_array($v)) $table=$k;
else $table=$v;
if(is_array($v)) {
//private
if(empty($this->keysecret) || $this->keysecret['key']!=$k) continue;

//$data=$global->get(strtolower($table));
$data=$global_local['public'][strtolower($table)];
if(empty($data)) continue;
$temp[$table]=$data;
foreach ($v as $vv){
$data=$global->getQueue(strtolower($vv));
$temp[strtolower($vv)]=$data;
}
} else {
//public

//$data=$global->get(strtolower($table));
$data=$global_local['public'][strtolower($v)];
if(empty($data)) continue;
$temp[$v]=$data;
}
}
}else{
//返回规定的数据
Expand All @@ -153,6 +162,7 @@ protected function getData($global,$callback=null,$sub=[]){
}else{
//public
//$data=$global->get(strtolower($v));

$data=$global_local['public'][strtolower($v)];
}
if(empty($data)) continue;
Expand Down

0 comments on commit 6e0f550

Please sign in to comment.