...
|
...
|
@@ -49,6 +49,7 @@ class IndexController extends AbstractAction |
|
|
// 渲染模板
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 异步获取购物车数据
|
|
|
*/
|
...
|
...
|
@@ -71,6 +72,22 @@ class IndexController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 异步获取购物车商品数目
|
|
|
*/
|
|
|
public function countAction()
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid(true);
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
|
|
$result = CartModel::getCartCount($uid, $shoppingKey);
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 购物车商品选择与取消
|
|
|
*/
|
|
|
public function selectAction()
|
...
|
...
|
@@ -84,11 +101,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::selectGoods($uid, $productId, $shoppingKey);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -106,11 +119,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::removeFromCart($uid, $sku, $count, $shoppingKey);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -126,11 +135,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::addToFav($uid, $productId);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/*
|
...
|
...
|
@@ -184,11 +189,7 @@ class IndexController extends AbstractAction |
|
|
$result['num'] = $num;
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/*
|
...
|
...
|
@@ -214,11 +215,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::giftProductData($skn, $promotionId);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -238,11 +235,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -264,11 +257,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::modifyCartProduct($uid, $params, $shoppingKey);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -318,11 +307,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -333,16 +318,12 @@ class IndexController extends AbstractAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$couponCode = $this->get('couponCode', '');
|
|
|
$couponCode = $this->post('couponCode', '');
|
|
|
$uid = $this->getUid(true);
|
|
|
$result = CartModel::searchCoupon($uid, $couponCode);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -357,11 +338,7 @@ class IndexController extends AbstractAction |
|
|
$result = CartModel::getCouponList($uid);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|