thinkPHP实现的联动菜单功能详解

时间:2017-05-08

然后,数据表是怎么样的数据呢:

Array
(
  [0] => Array
    (
      [category_id] => 211
      [category_name] => 鞋柜
      [parent_id] => 31
      [listorder] => 200
      [display] => 1
    )
  [1] => Array
    (
      [category_id] => 194
      [category_name] => 相框/照片墙
      [parent_id] => 189
      [listorder] => 200
      [display] => 1
    )
  [2] => Array
    (
      [category_id] => 193
      [category_name] => 帘艺隔断
      [parent_id] => 189
      [listorder] => 200
      [display] => 1
    )
  [3] => Array
    (
      [category_id] => 192
      [category_name] => 沙发垫套/椅垫
      [parent_id] => 189
      [listorder] => 200
      [display] => 1
    )
  [4] => Array
    (
      [category_id] => 191
      [category_name] => 地毯地垫
      [parent_id] => 189
      [listorder] => 200
      [display] => 1
    )
  [5] => Array
    (
      [category_id] => 190
      [category_name] => 桌布/罩件
      [parent_id] => 189
      [listorder] => 200
      [display] => 1
    )

数据表数据是酱紫的;

然后,你能写出那个处理数组的方法吗,给你原数据,然后你用迭代处理成你想要的数据,不用太多,6行代码左右,你OK?

  • 共3页:
  • 上一页
  • 2/3
  • 下一页
  • 上一篇:Thinkphp 空操作、空控制器、命名空间(详解) 下一篇:thinkPHP实现的省市区三级联动功能示例

    相关文章

    最新文章