Showing
1 changed file
with
3 additions
and
0 deletions
@@ -92,6 +92,9 @@ class HomeModel | @@ -92,6 +92,9 @@ class HomeModel | ||
92 | // 'subnav' => array() | 92 | // 'subnav' => array() |
93 | ); | 93 | ); |
94 | $indexSub = 0; | 94 | $indexSub = 0; |
95 | + | ||
96 | + //判断sub变量是否存在 | ||
97 | + $val['sub'] = empty($val['sub']) ? array() : $val['sub']; | ||
95 | foreach ($val['sub'] as $sub) { // 二级 | 98 | foreach ($val['sub'] as $sub) { // 二级 |
96 | $subnav = array( | 99 | $subnav = array( |
97 | 'name' => $sub['sort_name'], | 100 | 'name' => $sub['sort_name'], |
-
Please register or login to post a comment