...
|
...
|
@@ -17,6 +17,7 @@ use Plugin\UnionTrans; |
|
|
*/
|
|
|
class IndexController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 通过当前用户审判是否跳到登录
|
|
|
*
|
...
|
...
|
@@ -34,6 +35,7 @@ class IndexController extends AbstractAction |
|
|
/*
|
|
|
* 购物车首页
|
|
|
*/
|
|
|
|
|
|
public function indexAction()
|
|
|
{
|
|
|
$this->setTitle('购物车');
|
...
|
...
|
@@ -55,6 +57,7 @@ class IndexController extends AbstractAction |
|
|
/*
|
|
|
* 异步获取购物车数据
|
|
|
*/
|
|
|
|
|
|
public function getCartDataAction()
|
|
|
{
|
|
|
$result = array();
|
...
|
...
|
@@ -143,6 +146,7 @@ class IndexController extends AbstractAction |
|
|
/*
|
|
|
* 赠品页面
|
|
|
*/
|
|
|
|
|
|
public function giftAction()
|
|
|
{
|
|
|
$this->setTitle('赠品');
|
...
|
...
|
@@ -161,6 +165,7 @@ class IndexController extends AbstractAction |
|
|
/*
|
|
|
* 加价购页面
|
|
|
*/
|
|
|
|
|
|
public function advanceBuyAction()
|
|
|
{
|
|
|
$this->setTitle('加价购');
|
...
|
...
|
@@ -179,6 +184,7 @@ class IndexController extends AbstractAction |
|
|
/*
|
|
|
* 获取购物车商品数据
|
|
|
*/
|
|
|
|
|
|
public function goodinfoAction()
|
|
|
{
|
|
|
$result = array();
|
...
|
...
|
@@ -234,7 +240,7 @@ class IndexController extends AbstractAction |
|
|
$shoppingKey = $this->getSession('shoppingKey');
|
|
|
$uid = $this->getUid(true);
|
|
|
|
|
|
$sku= $this->post('sku', 0);
|
|
|
$sku = $this->post('sku', 0);
|
|
|
$increaseNum = $this->post('increaseNum', null);
|
|
|
$decreaseNum = $this->post('decreaseNum', null);
|
|
|
$result = CartModel::modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey);
|
...
|
...
|
@@ -255,10 +261,10 @@ class IndexController extends AbstractAction |
|
|
$uid = $this->getUid(true);
|
|
|
|
|
|
$params = array();
|
|
|
$params['old_product_sku']= $this->post('old_product_sku', 0);
|
|
|
$params['new_product_sku']= $this->post('new_product_sku', 0);
|
|
|
$params['buy_number']= $this->post('buy_number', 0);
|
|
|
$params['selected']= $this->post('selected', null);
|
|
|
$params['old_product_sku'] = $this->post('old_product_sku', 0);
|
|
|
$params['new_product_sku'] = $this->post('new_product_sku', 0);
|
|
|
$params['buy_number'] = $this->post('buy_number', 0);
|
|
|
$params['selected'] = $this->post('selected', null);
|
|
|
$result = CartModel::modifyCartProduct($uid, $params, $shoppingKey);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -275,7 +281,6 @@ class IndexController extends AbstractAction |
|
|
|
|
|
$this->setTitle('确认订单');
|
|
|
$this->setNavHeader('确认订单', Helpers::url('/cart/index/index'), false); // 不显示右上角home按钮
|
|
|
|
|
|
// 购物车商品为空跳转到购物车页面
|
|
|
$cartType = $this->get('cartType', '');
|
|
|
$cookieData = $this->getCookie('order-info', null);
|
...
|
...
|
@@ -424,9 +429,9 @@ class IndexController extends AbstractAction |
|
|
} else {
|
|
|
// 提交成功清除Cookie
|
|
|
$this->setCookie('order-info', null);
|
|
|
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
|
|
|
|
|
|
if ($uid && !empty($result['data'])) {
|
|
|
try {
|
|
|
UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']);
|
...
|
...
|
|