素材牛VIP会员
thinkphp取消调试模式下面就无法输出了 帮忙看看什么问题 打开调试模式就有了..
 驱***森  分类:ThinkPHP  人气:873  回帖:1  发布于6年前 收藏
public function getAllDishCategory(){

    $m = M('dish_category'); /* 不能删除 */

    /* 无限分类 */
    function getList($pid=0,&$result=array(),$spac=0){

        $shopid=trim(I('request.shopid'))?trim(I('request.shopid')):session('shopid');

        $spac=$spac+8;
        $sql="SELECT * FROM chi_dish_category WHERE dishcategory_pid=$pid AND dishcategory_shopid=$shopid  AND dishcategory_isdisplay=1 order by dishcategory_sort";
        $res=mysql_query($sql);
        while($row=mysql_fetch_assoc($res)){
            $row['dishcategory_oldname']=$row['dishcategory_name'];
            $row['dishcategory_name']=str_repeat(' ',$spac).'|--'.$row['dishcategory_name'];
            $result[]=$row;
            getList($row['dishcategory_id'],$result,$spac);
        }
        return $result;
    }

    return $list=getList();

    /* 无限分类 结束 */

}
 标签:thinkphp

讨论这个帖子(1)垃圾回帖将一律封号处理……

Lv3 码奴
wu***su 移动开发工程师 6年前#1
 文明上网,理性发言!   😉 阿里云幸运券,戳我领取