Authored by Rock Zhang

修复订单数据处理有关逻辑的bug

@@ -26,7 +26,7 @@ class HomeController extends AbstractAction @@ -26,7 +26,7 @@ class HomeController extends AbstractAction
26 $this->setNavHeader('个人中心', true, SITE_MAIN); 26 $this->setNavHeader('个人中心', true, SITE_MAIN);
27 27
28 // $uid = $this->getUid(); 28 // $uid = $this->getUid();
29 - $uid = 967016; 29 + $uid = 8826435;
30 $data = \Index\UserModel::getUserProfileData($uid); 30 $data = \Index\UserModel::getUserProfileData($uid);
31 $data += \Index\UserModel::getInfoNumData($uid); 31 $data += \Index\UserModel::getInfoNumData($uid);
32 32
@@ -46,10 +46,15 @@ class HomeController extends AbstractAction @@ -46,10 +46,15 @@ class HomeController extends AbstractAction
46 */ 46 */
47 public function ordersAction() 47 public function ordersAction()
48 { 48 {
49 - // $uid = $this->getUid();  
50 - // $type = $this->get('type', 1); 49 + // 设置网站标题
  50 + $this->setTitle('我的订单');
  51 + $this->setNavHeader('我的订单', true, SITE_MAIN);
51 52
52 - // $orders = \Index\UserModel::getUserOrderData(967016, $type); 53 + $uid = $this->getUid();
  54 + $uid = 8826435;
  55 + $type = $this->get('type', 1);
  56 +
  57 + $order = \Index\UserModel::getUserOrderData($uid, $type);
53 58
54 $order = array( 59 $order = array(
55 'orders' => array( 60 'orders' => array(
@@ -85,7 +90,6 @@ class HomeController extends AbstractAction @@ -85,7 +90,6 @@ class HomeController extends AbstractAction
85 ); 90 );
86 91
87 $this->_view->display('order', array('order' => $order, 'orderPage' => true)); 92 $this->_view->display('order', array('order' => $order, 'orderPage' => true));
88 - // print_r($orders);  
89 } 93 }
90 94
91 /** 95 /**
@@ -380,7 +384,7 @@ class HomeController extends AbstractAction @@ -380,7 +384,7 @@ class HomeController extends AbstractAction
380 $this->setTitle('会员等级'); 384 $this->setTitle('会员等级');
381 //显示网站导航头部信息 385 //显示网站导航头部信息
382 $this->setNavHeader('会员等级'); 386 $this->setNavHeader('会员等级');
383 - 387 +
384 $gender = Helpers::getGenderByCookie(); 388 $gender = Helpers::getGenderByCookie();
385 $channel = Helpers::getChannelByCookie(); 389 $channel = Helpers::getChannelByCookie();
386 $uid = $this -> getUid(); 390 $uid = $this -> getUid();
@@ -103,8 +103,6 @@ class UserModel @@ -103,8 +103,6 @@ class UserModel
103 103
104 // 处理用户订单数据 104 // 处理用户订单数据
105 if (isset($orderData['data']) && !empty($orderData['data'])) { 105 if (isset($orderData['data']) && !empty($orderData['data'])) {
106 - $result = $orderData['data'];  
107 -  
108 $oneOrder = array(); 106 $oneOrder = array();
109 foreach ($orderData['data']['order_list'] as $val) { 107 foreach ($orderData['data']['order_list'] as $val) {
110 $oneOrder = array(); 108 $oneOrder = array();
@@ -120,21 +118,18 @@ class UserModel @@ -120,21 +118,18 @@ class UserModel
120 $oneGoods = array(); 118 $oneGoods = array();
121 $oneGoods['id'] = 1; 119 $oneGoods['id'] = 1;
122 $oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80); 120 $oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
123 - $oneGoods['name'] = $val['product_name'];  
124 - $oneGoods['color'] = $val['color_name'];  
125 - $oneGoods['size'] = $val['size_name'];  
126 - $oneGoods['size_name'] = $val['size_name'];  
127 - $oneGoods['price'] = $val['goods_price'];  
128 - $oneGoods['count'] = $val['buy_number'];  
129 -  
130 - $result['goods'][] = $oneGoods; 121 + $oneGoods['name'] = $goods['product_name'];
  122 + $oneGoods['color'] = $goods['color_name'];
  123 + $oneGoods['size'] = $goods['size_name'];
  124 + $oneGoods['price'] = $goods['goods_price'];
  125 + $oneGoods['count'] = $goods['buy_number'];
  126 +
  127 + $oneOrder[] = $oneGoods;
131 } 128 }
132 129
133 $result['orders'][] = $oneOrder; 130 $result['orders'][] = $oneOrder;
134 } 131 }
135 -  
136 } 132 }
137 - print_r($result);  
138 133
139 return $result; 134 return $result;
140 } 135 }