commit | author | age
|
e2b48d
|
1 |
<?php |
B |
2 |
|
|
3 |
/** |
|
4 |
* 文章分类 |
|
5 |
*/ |
|
6 |
define('IN_ECS', true); |
|
7 |
require('includes/init.php'); |
|
8 |
$result=array(); |
|
9 |
$result2=array(); |
|
10 |
$res = $db -> getAll("SELECT cat_id,cat_name FROM ".$ecs->table('article_cat')." WHERE parent_id='0' and cat_type='1' and show_in_nav='0' order by sort_order asc"); |
|
11 |
foreach ($res as $key=>$val) |
|
12 |
{ |
|
13 |
$parent_id=$val['cat_id']; |
|
14 |
$result2['cat_id']=$val['cat_id']; |
|
15 |
$result2['cat_name']=$val['cat_name']; |
|
16 |
$rows = $db -> getAll("SELECT cat_id,cat_name FROM ".$ecs->table('article_cat')." WHERE parent_id='$parent_id' and cat_type='1' order by sort_order asc"); |
|
17 |
$result2['list']=$rows; |
|
18 |
$result[]=$result2; |
|
19 |
} |
|
20 |
|
|
21 |
print_r(json_encode($result)); |
|
22 |
|
|
23 |
?> |