Authored by yangyang

改动格式

... ... @@ -495,8 +495,12 @@ class HomeController extends AbstractAction
if (!empty($data)) {
$order['orders'] = $data;
} else {
if ($page > 1) {
echo " ";
} else {
$order['walkwayUrl'] = 'http://www.baidu.com';
}
}
//渲染模板
$this->_view->display('order-content', $order);
}
... ...
... ... @@ -123,44 +123,48 @@ class OrderModel
}
//根据type值设置nav属性
public function getNavs($type){
public function getNavs($type) {
$nav = array(
array(
'name' => '全部',
'typeId' => '1'
'typeId' => '1',
'url' => '/home/order?type=1'
),
array(
'name' => '待付款',
'typeId' => '2'
'typeId' => '2',
'url' => '/home/order?type=2'
),
array(
'name' => '待发货',
'typeId' => '3'
'typeId' => '3',
'url' => '/home/order?type=3'
),
array(
'name' => '待收货',
'typeId' => '4'
'typeId' => '4',
'url' => '/home/order?type=4'
)
);
foreach($nav as $key => $vo){
foreach ($nav as $key => $vo) {
switch ($type) {
case 1:
if($vo['typeId'] == 1){
if ($vo['typeId'] == 1) {
$nav[$key]['active'] = true;
}
break;
case 2:
if($vo['typeId'] == 2){
if ($vo['typeId'] == 2) {
$nav[$key]['active'] = true;
}
break;
case 3:
if($vo['typeId'] == 3){
if ($vo['typeId'] == 3) {
$nav[$key]['active'] = true;
}
break;
case 4:
if($vo['typeId'] == 4){
if ($vo['typeId'] == 4) {
$nav[$key]['active'] = true;
}
break;
... ... @@ -169,7 +173,6 @@ class OrderModel
}
}
return $nav;
}
}
... ...