This commit is contained in:
wangjinlei
2020-11-14 12:31:55 +08:00
parent c0a62b39a9
commit 0f63d12e62

View File

@@ -322,10 +322,26 @@ class Journal extends Controller {
$frag[] = $v;
}
}
$ff = [];
foreach ($frag as $kk => $vv){
$frag[$kk] = $this->getChieldarr($vv,$res);
$ff[] = $this->getpChieldarr($vv, $res);
// $frag[$kk] = $this->getChieldarr($vv,$res);
}
return json(['code'=>0,'msg'=>'success','data'=>['parentList'=>$frag]]);
return json(['code'=>0,'msg'=>'success','data'=>['parentList'=>$ff]]);
}
private function getpChieldarr($vv,$res){
if($vv['is_final']==1){
return $vv;
}
$frag = [];
$frag[] = $vv;
foreach ($res as $v){
if($v['parent_id'] == $vv['journal_topic_id']){
$frag[] = $this->getChieldarr($v, $res);
}
}
return $frag;
}
/**