Authored by Rock Zhang

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

... ... @@ -26,7 +26,7 @@ class HomeController extends AbstractAction
$this->setNavHeader('个人中心', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$uid = 8826435;
$data = \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
... ... @@ -46,10 +46,15 @@ class HomeController extends AbstractAction
*/
public function ordersAction()
{
// $uid = $this->getUid();
// $type = $this->get('type', 1);
// 设置网站标题
$this->setTitle('我的订单');
$this->setNavHeader('我的订单', true, SITE_MAIN);
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
$uid = $this->getUid();
$uid = 8826435;
$type = $this->get('type', 1);
$order = \Index\UserModel::getUserOrderData($uid, $type);
$order = array(
'orders' => array(
... ... @@ -85,7 +90,6 @@ class HomeController extends AbstractAction
);
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
// print_r($orders);
}
/**
... ... @@ -380,7 +384,7 @@ class HomeController extends AbstractAction
$this->setTitle('会员等级');
//显示网站导航头部信息
$this->setNavHeader('会员等级');
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this -> getUid();
... ...
... ... @@ -103,8 +103,6 @@ class UserModel
// 处理用户订单数据
if (isset($orderData['data']) && !empty($orderData['data'])) {
$result = $orderData['data'];
$oneOrder = array();
foreach ($orderData['data']['order_list'] as $val) {
$oneOrder = array();
... ... @@ -120,21 +118,18 @@ class UserModel
$oneGoods = array();
$oneGoods['id'] = 1;
$oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
$oneGoods['name'] = $val['product_name'];
$oneGoods['color'] = $val['color_name'];
$oneGoods['size'] = $val['size_name'];
$oneGoods['size_name'] = $val['size_name'];
$oneGoods['price'] = $val['goods_price'];
$oneGoods['count'] = $val['buy_number'];
$result['goods'][] = $oneGoods;
$oneGoods['name'] = $goods['product_name'];
$oneGoods['color'] = $goods['color_name'];
$oneGoods['size'] = $goods['size_name'];
$oneGoods['price'] = $goods['goods_price'];
$oneGoods['count'] = $goods['buy_number'];
$oneOrder[] = $oneGoods;
}
$result['orders'][] = $oneOrder;
}
}
print_r($result);
return $result;
}
... ...