40分求ThinkPHP循环嵌套打印出父类与子类的列表
大家好,我近段时间在学习thinkPHP框架,我想在模板页面实现循环打印出一个数据列表,格式是:先是父类类别名称,再接着打印出对应的子类列表,再接着打印另外一个父类名称,再打印该父类的对应的子类,以此类推。。。我是用表格排版,格式如:
类别名 简介
父类名称1 ......
子类名称1 .....
子类名称2 .....
子类名称3 .....
父类名称2 ......
子类名称1 .....
子类名称2 .....
子类名称3 .....
请问用volist该怎样实现,或者有没有更好的方法,请指教,感激不尽!!
------解决方案--------------------
使用地归来进行遍历就可以了
------解决方案--------------------
可以一试:第一次我都环找出所有parent_id然后记下该记录集的总量parent_count,然后以parent_count往下循环,以此类推……
------解决方案--------------------
{$vo.depa_id}
echo '[主页面] '; ?>{$vo.depa_title}
{$vo.label_count}
{$vo.model_name}
{$vo.depa_order}
{$son.depa_id}
------解决方案--------------------
-" title="
------解决方案--------------------
-" />{$son.depa_title}
{$son.label_count}
{$son.model_name}