<ul >{$v2.catename}</a>
{/if}
</li>
<?php endforeach; ?>
</ul>
{/if}
</li>
{/volist}
</ul>

     public function  getNavCates(){
         //获取导航列表及子列表
         $cateres=db('cate')->where('pid',0)->select();
         foreach ($cateres as $k=> $v){
             $children=db('cate')->where('pid',$v['id'])->select();
             if($children){
                 $cateres[$k]['children']=$children;
                // dump($children);die;
             }else{
                 $cateres[$k]['children']=0;
             }
         }
       //  dump($cateres);die;
         $this->assign('cateres',$cateres);
     }

 

相关文章:

  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-10-29
  • 2021-05-18
  • 2022-12-23
  • 2021-07-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-06-10
  • 2021-06-08
  • 2021-06-06
相关资源
相似解决方案