Authored by 郝肖肖

判断sub 变量 是否存在

... ... @@ -92,6 +92,9 @@ class HomeModel
// 'subnav' => array()
);
$indexSub = 0;
//判断sub变量是否存在
$val['sub'] = empty($val['sub']) ? array() : $val['sub'];
foreach ($val['sub'] as $sub) { // 二级
$subnav = array(
'name' => $sub['sort_name'],
... ...