...
|
...
|
@@ -21,7 +21,7 @@ class IndexController extends WebAction |
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
|
|
|
|
|
// 显示一次并清除已删除的COOKIE记录
|
...
|
...
|
@@ -52,7 +52,7 @@ class IndexController extends WebAction |
|
|
if ($this->isAjax()) {
|
|
|
$productId = $this->post('skuList', 0);
|
|
|
$hasPromotion = $this->post('hasPromotion', false);
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
|
|
$result = CartModel::selectGoods($uid, $productId, $shoppingKey, $hasPromotion);
|
|
|
}
|
...
|
...
|
@@ -75,7 +75,7 @@ class IndexController extends WebAction |
|
|
if ($this->isAjax()) {
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
|
|
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$sku = $this->post('sku', 0);
|
|
|
$increaseNum = $this->post('increaseNum', null);
|
|
|
$decreaseNum = $this->post('decreaseNum', null);
|
...
|
...
|
@@ -103,7 +103,7 @@ class IndexController extends WebAction |
|
|
if ($this->isAjax()) {
|
|
|
$skuList = $this->post('skuList', 0);
|
|
|
$hasPromotion = true; //$this->post('hasPromotion', false);
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
|
|
$result = CartModel::removeFromCart($uid, $skuList, $shoppingKey, $hasPromotion);
|
|
|
if (!empty($result['code']) && $result['code'] == 200) {
|
...
|
...
|
@@ -130,7 +130,7 @@ class IndexController extends WebAction |
|
|
if ($this->isAjax()) {
|
|
|
$skuList = $this->post('skuList');
|
|
|
$hasPromotion = $this->post('hasPromotion', false);
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$result = CartModel::addToFav($uid, $skuList, $hasPromotion);
|
|
|
if (!empty($result['code']) && $result['code'] == 200) {
|
|
|
$this->setShoppingCookie($uid);
|
...
|
...
|
@@ -217,14 +217,14 @@ class IndexController extends WebAction |
|
|
$refer = Helpers::url('/cart/index/orderEnsure', array('type' => $type));
|
|
|
|
|
|
// 审判用户是否已登录
|
|
|
$this->auditJumpLogin(true, $refer);
|
|
|
$this->auditJumpLogin(false, $refer);
|
|
|
|
|
|
$this->setTitle('填写订单', true, ' | ');
|
|
|
$this->setSimpleHeader();
|
|
|
|
|
|
$cartType = ($type == 2) ? 'advance' : 'ordinary';
|
|
|
$isAdvanceCart = ($type == 2) ? true : false;
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
|
|
|
$orderEnsure = CartModel::cartPay($uid, $cartType, $isAdvanceCart);
|
|
|
if (empty($orderEnsure)) {
|
...
|
...
|
@@ -247,7 +247,7 @@ class IndexController extends WebAction |
|
|
$result = array('code' => 200, 'data' => array(), 'message' => '地址信息');
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$result['data'] = CartModel::userAddressList($uid);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -265,7 +265,7 @@ class IndexController extends WebAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$addressId = $this->post('id');
|
|
|
$result = CartModel::setDefaultAddress($uid, $addressId);
|
|
|
}
|
...
|
...
|
@@ -292,7 +292,7 @@ class IndexController extends WebAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$id = $this->post('id', null);
|
|
|
$address = $this->post('address', '');
|
|
|
$areaCode = $this->post('areaCode', '');
|
...
|
...
|
@@ -324,7 +324,7 @@ class IndexController extends WebAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$addressId = $this->post('id');
|
|
|
$result = CartModel::delAddress($uid, $addressId);
|
|
|
}
|
...
|
...
|
@@ -360,7 +360,7 @@ class IndexController extends WebAction |
|
|
$result = array('code' => 200, 'message' => '优惠券信息', 'data' => array());
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$result['data'] = CartModel::getCouponList($uid);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -389,7 +389,7 @@ class IndexController extends WebAction |
|
|
$couponCode = $this->post('couponCode', null);
|
|
|
$yohoCoin = $this->post('yohoCoin', null);
|
|
|
$redEnvelopes = $this->post('redEnvelopes', null);
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $redEnvelopes);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -426,7 +426,7 @@ class IndexController extends WebAction |
|
|
}
|
|
|
|
|
|
// 判断用户是否登录
|
|
|
$uid = $this->getUid(true);
|
|
|
$uid = $this->getUid(false);
|
|
|
if (!$uid) {
|
|
|
$result['message'] = '请先登录';
|
|
|
break;
|
...
|
...
|
|