{category module=share pid=0} {php $api[$key]=[];} {php $api[$key]['id']=$t['id'];} {php $api[$key]['name']=$t['name'];} {php $api[$key]['url']=$t['url'];} {php $api[$key]['next']=[];} {if $t.child} {category module=share pid=$t.id return=t2} {php $api[$key]['next'][$key_t2]=[];} {php $api[$key]['next'][$key_t2]['id']=$t2['id'];} {php $api[$key]['next'][$key_t2]['name']=$t2['name'];} {php $api[$key]['next'][$key_t2]['url']=$t2['url'];} {if $t2.child} {category module=share pid=$t2.id return=t3} {php $api[$key]['next'][$key_t3]=[];} {php $api[$key]['next'][$key_t3]['id']=$t3['id'];} {php $api[$key]['next'][$key_t3]['name']=$t3['name'];} {php $api[$key]['next'][$key_t3]['url']=$t3['url'];} {if $t3.child} {category module=share pid=$t3.id return=t4} {php $api[$key]['next'][$key_t4]=[];} {php $api[$key]['next'][$key_t4]['id']=$t4['id'];} {php $api[$key]['next'][$key_t4]['name']=$t4['name'];} {php $api[$key]['next'][$key_t4]['url']=$t4['url'];} {/category} {/if} {/category} {/if} {/category} {/if} {/category}