Authored by yangyang

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

... ... @@ -160,6 +160,7 @@ class HomeController extends AbstractAction
$this->_view->display('coupons', $coupons);
}
/**
* 优惠券
*/
... ... @@ -220,8 +221,7 @@ class HomeController extends AbstractAction
/**
* 修改地址或者添加新地址
*/
public function saveAddressAction()
{
public function saveAddressAction() {
$result = array();
if ($this->isAjax()) {
... ... @@ -243,14 +243,12 @@ class HomeController extends AbstractAction
} else {
$this->echoJson($result);
}
}
/**
* 设置默认地址
*/
public function defaultAddressAction()
{
public function defaultAddressAction() {
$result = array();
if ($this->isAjax()) {
... ... @@ -266,7 +264,6 @@ class HomeController extends AbstractAction
} else {
$this->echoJson($result);
}
}
//在线客服
... ... @@ -289,8 +286,7 @@ class HomeController extends AbstractAction
$service = array();
$cateId = $this->get('cateId', 0);
$cateName = $this->get('cateName', '');
if ($cateId > 0)
{
if ($cateId > 0) {
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
}
$this->setTitle('在线客服');
... ... @@ -412,11 +408,17 @@ class HomeController extends AbstractAction
$uid = '7566245'; //测试用
//调用模型层getOrder方法获得并处理数据
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
//如果没有订单数据,就给一个随便逛逛链接
$order = array();
if (!empty($data)) {
$order['orders'] = $data;
} else {
$order['walkwayUrl'] = 'http://www.baidu.com';
}
//渲染模板
$this->_view->display('order', array(
'order' => array(
'orders' => $data
)
'order' => $order
));
}
... ...
... ... @@ -39,7 +39,7 @@ class OrderModel
foreach ($data['data']['order_list'] as $key => $vo) {
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
$result[$key]['tradingStatus'] = $vo['status_str'];
$result[$key]['orderStatus'] = $vo['status_str'];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost'];
//订单商品列表数据
... ...