你好如何设置三级菜单在问题库并显示出来,默认只显示二级分类菜单 我在new文件添加了div的标签 邀请回答

2019-09-26 14:23发布

                                                                                             标签:    ...

 


                                      

                                          
          标签:
       

                                      

                                      

                                       {if isset($cid)&&$cid!='all'}
                                        
                                         {else}
                                           

                                         {/if}
                                          
                                               全部
                                          

                                          

                                           {if isset($pid)&&$pid!=0}
                                          
                                              {eval $_cid1=intval($pid); $subcatlist=$this->getlistbysql("select id,name,displayorder,grade from ".$this->db->dbprefix."category where  iscourse=0 and isuseask=1 and grade=2  and pid=$_cid1 order by displayorder desc ");}
      
                                           {else}
                                           {if isset($cid)&&$cid!='all'}
                                            {eval $_cid1=intval($cid); $subcatlist=$this->getlistbysql("select id,name,displayorder,grade from ".$this->db->dbprefix."category where  iscourse=0 and isuseask=1 and grade=2  and pid=$_cid1 order by displayorder desc ");}
      
                                           {else}
                                              {eval  $subcatlist=$this->getlistbysql("select id,name,displayorder,grade from ".$this->db->dbprefix."category where  iscourse=0 and isuseask=1 and grade=2  order by displayorder desc ");}
      
                                           {/if}
                                          
                                          
                                           {/if}
                                                        
        {if $subcatlist}
        
         {if  $sindex<20>                                    

           {$subcat['name']}

                                          
                                          
                                           {/if}
                                            
                                   
                                        
         {if  $sindex>=20}
                                    

           {$subcat['name']}

                                          
                                          
                                           {/if}
                                            
                                                                                  {if count($subcatlist)>=20}
                 


                                查看更多
                           

                      {/if}     
                                                  {/if}
                                     
                                      

                                  




这段代码复制后  该怎么修改   往new里面添加

付费偷看设置
发送
2条回答
bbbbbb - 网站测试人员
1楼 · 2019-09-30 09:26.采纳回答

你贴代码还不如发图片,这看起来挺糟糕,如果是三级分类,先获取到二级分类,然后在遍历当前二级分类下三级分类,循环输出

mishen - whatsns产品经理
2楼-- · 2019-10-14 20:08

image.png

像这样吗?