加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bootstrap Treeview 树形结构 无限极二维数组层级关系

发布时间:2020-12-18 00:31:38 所属栏目:安全 来源:网络整理
导读:div class="cnblogs_code" 1 2 = 3 = ->send_post('请求数据地址/?msgid=121authkey=webuseraccountid='. ['id'].'projectid='. ['projectid'].'', 4 = json_decode( , 5 6 7 = 8 ( ['regions'] 9 [ ['id']] = 10 11 12 14 15 16 17 = 18 ( => 19 [ ]['id']

<div class="cnblogs_code">

 1  2      = 3      = ->send_post('请求数据地址/?msgid=121&authkey=webuser&accountid='.['id'].'&projectid='.['projectid'].'',4      = json_decode(,5     
 6     
 7      = 8     (['regions']  9         [['id']] = 1011    
12       
14 
15     
16     
17      = 18     (  =>19         []['id'] = ['id'20         []['text'] = ['name'21         []['parentid'] = ['parentid'22         []['projectid'] = ['projectid'23         []['projectname'] = ['projectname'2425 
26     
27     
28      = 29     (   => 30         
31         
32         (([['parentid'33             [['parentid']]['nodes'][] = &[34             
35         }36             [] = &[];  
373839      json_encode();40 }

// 结果 我这里数据有点少 但是基本上看的清楚 如果还有 子类 孙子类 都会追加到相应的父类后面

1 2 (33 [0] => (64 ["id"] => int(495 ["text"] => (12) "车身车间" 6 ["parentid"] => int(07 ["projectid"] => int(168 ["projectname"] => (12) "南京大通" 9 ["nodes"] => (110 [0] => (511 ["id"] => int(7512 ["text"] => (3) "456" 13 ["parentid"] => int(4914 ["projectid"] => int(1615 ["projectname"] => (12) "南京大通" 16171819 [1] => (620 ["id"] => int(5021 ["text"] => (12) "冲压车间" 22 ["parentid"] => int(023 ["projectid"] => int(1624 ["projectname"] => (12) "南京大通" 25 ["nodes"] => (126 [0] => (527 ["id"] => int(7828 ["text"] => (3) "666" 29 ["parentid"] => int(5030 ["projectid"] => int(1631 ["projectname"] => (12) "南京大通" 32333435 [2] => (536 ["id"] => int(8237 ["text"] => (12) "总装车间" 38 ["parentid"] => int(039 ["projectid"] => int(1640 ["projectname"] => (12) "南京大通" 4142 }

前台展示

1

<div class="cnblogs_code">

 1 
 2