Authored by yangyang

修改订单为空时,写入随便逛逛地址

@@ -160,6 +160,7 @@ class HomeController extends AbstractAction @@ -160,6 +160,7 @@ class HomeController extends AbstractAction
160 160
161 $this->_view->display('coupons', $coupons); 161 $this->_view->display('coupons', $coupons);
162 } 162 }
  163 +
163 /** 164 /**
164 * 优惠券 165 * 优惠券
165 */ 166 */
@@ -220,8 +221,7 @@ class HomeController extends AbstractAction @@ -220,8 +221,7 @@ class HomeController extends AbstractAction
220 /** 221 /**
221 * 修改地址或者添加新地址 222 * 修改地址或者添加新地址
222 */ 223 */
223 - public function saveAddressAction()  
224 - { 224 + public function saveAddressAction() {
225 $result = array(); 225 $result = array();
226 226
227 if ($this->isAjax()) { 227 if ($this->isAjax()) {
@@ -243,14 +243,12 @@ class HomeController extends AbstractAction @@ -243,14 +243,12 @@ class HomeController extends AbstractAction
243 } else { 243 } else {
244 $this->echoJson($result); 244 $this->echoJson($result);
245 } 245 }
246 -  
247 } 246 }
248 247
249 /** 248 /**
250 * 设置默认地址 249 * 设置默认地址
251 */ 250 */
252 - public function defaultAddressAction()  
253 - { 251 + public function defaultAddressAction() {
254 $result = array(); 252 $result = array();
255 253
256 if ($this->isAjax()) { 254 if ($this->isAjax()) {
@@ -266,7 +264,6 @@ class HomeController extends AbstractAction @@ -266,7 +264,6 @@ class HomeController extends AbstractAction
266 } else { 264 } else {
267 $this->echoJson($result); 265 $this->echoJson($result);
268 } 266 }
269 -  
270 } 267 }
271 268
272 //在线客服 269 //在线客服
@@ -289,8 +286,7 @@ class HomeController extends AbstractAction @@ -289,8 +286,7 @@ class HomeController extends AbstractAction
289 $service = array(); 286 $service = array();
290 $cateId = $this->get('cateId', 0); 287 $cateId = $this->get('cateId', 0);
291 $cateName = $this->get('cateName', ''); 288 $cateName = $this->get('cateName', '');
292 - if ($cateId > 0)  
293 - { 289 + if ($cateId > 0) {
294 $service = home\OnlineModel::getOnlineServiceDetail($cateId); 290 $service = home\OnlineModel::getOnlineServiceDetail($cateId);
295 } 291 }
296 $this->setTitle('在线客服'); 292 $this->setTitle('在线客服');
@@ -412,11 +408,17 @@ class HomeController extends AbstractAction @@ -412,11 +408,17 @@ class HomeController extends AbstractAction
412 $uid = '7566245'; //测试用 408 $uid = '7566245'; //测试用
413 //调用模型层getOrder方法获得并处理数据 409 //调用模型层getOrder方法获得并处理数据
414 $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); 410 $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
  411 + //如果没有订单数据,就给一个随便逛逛链接
  412 + $order = array();
  413 + if (!empty($data)) {
  414 + $order['orders'] = $data;
  415 + } else {
  416 + $order['walkwayUrl'] = 'http://www.baidu.com';
  417 + }
  418 +
415 //渲染模板 419 //渲染模板
416 $this->_view->display('order', array( 420 $this->_view->display('order', array(
417 - 'order' => array(  
418 - 'orders' => $data  
419 - ) 421 + 'order' => $order
420 )); 422 ));
421 } 423 }
422 424
@@ -39,7 +39,7 @@ class OrderModel @@ -39,7 +39,7 @@ class OrderModel
39 foreach ($data['data']['order_list'] as $key => $vo) { 39 foreach ($data['data']['order_list'] as $key => $vo) {
40 //订单号,支付状态,订单商品数量,订单总价格 40 //订单号,支付状态,订单商品数量,订单总价格
41 $result[$key]['orderNum'] = $vo['order_code']; 41 $result[$key]['orderNum'] = $vo['order_code'];
42 - $result[$key]['tradingStatus'] = $vo['status_str']; 42 + $result[$key]['orderStatus'] = $vo['status_str'];
43 $result[$key]['count'] = count($vo['order_goods']); 43 $result[$key]['count'] = count($vo['order_goods']);
44 $result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost']; 44 $result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost'];
45 //订单商品列表数据 45 //订单商品列表数据