php query to get an array, and then you need to use this array to write the json interface.
Interface format:
[
{
"id": 4,
"name": "",
"open": false,
"children": [
{
"id": 5,
"name": "",
"open": false,
"checked": false
},
{
"id": 6,
"name": "",
"open": false,
"checked": false
},
{
"id": 333,
"name": "233333",
"open": false,
"checked": false
}
],
"checked": false
},
{
"id": 10,
"name": "",
"open": false,
"children": [
{
"id": 8,
"name": "",
"open": false,
"children": [
{
"id": 40,
"name": "",
"open": false,
"url": null,
"title": "40",
"checked": false,
"level": 2,
"check_Child_State": 0,
"check_Focus": false,
"checkedOld": false,
"dropInner": false,
"drag": false,
"parent": false
},
{
"id": 41,
"name": "",
"open": false,
"checked": false
},
{
"id": 42,
"name": "",
"open": false,
"checked": false
}
],
"checked": false
},
{
"id": 11,
"name": "",
"open": false,
"checked": false
},
{
"id": 13,
"name": "",
"open": false,
"children": [
{
"id": 34,
"name": "",
"open": false,
"checked": false
},
{
"id": 37,
"name": "",
"open": false,
"checked": false
},
{
"id": 38,
"name": "",
"open": false,
"checked": false
}
],
"checked": false
},
{
"id": 15,
"name": "",
"open": false,
"checked": false
}
],
"checked": false
}
]
Array contents:
array(14) {
[0]=>
array(10) {
["id"]=>
string(2) "30"
["name"]=>
string(6) ""
["pid"]=>
string(1) "0"
["level"]=>
string(1) "1"
["childid"]=>
string(97) "a:7:{i:0;s:2:"31";i:1;s:2:"53";i:2;s:2:"54";i:3;s:2:"55";i:4;s:2:"56";i:5;s:2:"61";i:6;s:2:"74";}"
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[1]=>
array(10) {
["id"]=>
string(2) "31"
["name"]=>
string(5) "T2"
["pid"]=>
string(2) "30"
["level"]=>
string(1) "2"
["childid"]=>
string(32) "a:2:{i:0;s:2:"67";i:1;s:2:"68";}"
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[2]=>
array(10) {
["id"]=>
string(2) "32"
["name"]=>
string(7) "2"
["pid"]=>
string(1) "0"
["level"]=>
string(1) "1"
["childid"]=>
string(71) "a:5:{i:0;s:2:"34";i:1;s:2:"57";i:2;s:2:"58";i:3;s:2:"59";i:4;s:2:"60";}"
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[3]=>
array(10) {
["id"]=>
string(2) "35"
["name"]=>
string(7) "2"
["pid"]=>
string(1) "0"
["level"]=>
string(1) "1"
["childid"]=>
string(32) "a:2:{i:0;s:2:"46";i:1;s:2:"64";}"
["sort"]=>
string(1) "2"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[4]=>
array(10) {
["id"]=>
string(2) "46"
["name"]=>
string(9) ""
["pid"]=>
string(2) "35"
["level"]=>
string(1) "2"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[5]=>
array(10) {
["id"]=>
string(2) "53"
["name"]=>
string(7) "3"
["pid"]=>
string(2) "30"
["level"]=>
string(1) "2"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[6]=>
array(10) {
["id"]=>
string(2) "58"
["name"]=>
string(9) ""
["pid"]=>
string(2) "32"
["level"]=>
string(1) "2"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[7]=>
array(10) {
["id"]=>
string(2) "59"
["name"]=>
string(9) ""
["pid"]=>
string(2) "32"
["level"]=>
string(1) "2"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[8]=>
array(10) {
["id"]=>
string(2) "64"
["name"]=>
string(6) ""
["pid"]=>
string(2) "35"
["level"]=>
string(1) "2"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[9]=>
array(10) {
["id"]=>
string(2) "68"
["name"]=>
string(7) "T"
["pid"]=>
string(2) "31"
["level"]=>
string(1) "3"
["childid"]=>
string(32) "a:2:{i:0;s:2:"69";i:1;s:2:"72";}"
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[10]=>
array(10) {
["id"]=>
string(2) "67"
["name"]=>
string(7) "T"
["pid"]=>
string(2) "31"
["level"]=>
string(1) "3"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[11]=>
array(10) {
["id"]=>
string(2) "69"
["name"]=>
string(7) "T"
["pid"]=>
string(2) "68"
["level"]=>
string(1) "4"
["childid"]=>
string(19) "a:1:{i:0;s:2:"73";}"
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[12]=>
array(10) {
["id"]=>
string(2) "72"
["name"]=>
string(7) "T"
["pid"]=>
string(2) "68"
["level"]=>
string(1) "4"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
[13]=>
array(10) {
["id"]=>
string(2) "73"
["name"]=>
string(7) "T"
["pid"]=>
string(2) "69"
["level"]=>
string(1) "5"
["childid"]=>
string(0) ""
["sort"]=>
string(1) "0"
["status"]=>
string(1) "0"
["type"]=>
string(0) ""
["remark"]=>
string(0) ""
["delete"]=>
string(1) "0"
}
}
problem description
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)