|
@@ -1,10 +1,8 @@
|
|
|
<?php
|
|
|
/**
|
|
|
- * 我的购物车
|
|
|
+ * 购物车
|
|
|
*/
|
|
|
|
|
|
-//use Shopnc\Tpl;
|
|
|
-
|
|
|
defined('InShopNC') or exit('Access Invalid!');
|
|
|
|
|
|
require_once (BASE_ROOT_PATH . '/helper/goods_helper.php');
|
|
@@ -112,9 +110,6 @@ class cartControl extends mobileControl
|
|
|
return self::outsuccess($ret);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 购物车列表
|
|
|
- */
|
|
|
public function cart_listOp()
|
|
|
{
|
|
|
if($_SESSION['is_login'] != 1) {
|
|
@@ -336,11 +331,6 @@ class cartControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 检查商品是否符合加入购物车条件
|
|
|
- * @param unknown $goods
|
|
|
- * @param number $quantity
|
|
|
- */
|
|
|
private function check_goods($goods_info, $quantity)
|
|
|
{
|
|
|
if(empty($quantity)) {
|
|
@@ -394,7 +384,7 @@ class cartControl extends mobileControl
|
|
|
$quantity = intval($new_cart_list[$value['cart_id']]);
|
|
|
if (intval($value['goods_num']) !== $quantity)
|
|
|
{
|
|
|
- if (!$this->_check_goods_storage($value, $quantity, $_SESSION['member_id'])) {
|
|
|
+ if (!$this->check_goods_storage($value, $quantity)) {
|
|
|
array_push($quantity_error, array('cart_id' => $value['cart_id'], 'quantity' => $quantity, 'err_info' => '库存不足'));
|
|
|
} else {
|
|
|
$data = array();
|
|
@@ -534,7 +524,6 @@ class cartControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private function do_del($cart_id)
|
|
|
{
|
|
|
$model_cart = Model('cart');
|
|
@@ -562,9 +551,6 @@ class cartControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 购物车删除
|
|
|
- */
|
|
|
public function cart_delOp()
|
|
|
{
|
|
|
if($_SESSION['is_login'] != 1) {
|
|
@@ -584,10 +570,7 @@ class cartControl extends mobileControl
|
|
|
self::outsuccess(array('result' => '1'));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 检查库存是否充足
|
|
|
- */
|
|
|
- private function _check_goods_storage($cart_info, $quantity, $member_id)
|
|
|
+ private function check_goods_storage($cart_info, $quantity)
|
|
|
{
|
|
|
$model_goods = Model('goods');
|
|
|
$model_bl = Model('p_bundling');
|
|
@@ -596,11 +579,7 @@ class cartControl extends mobileControl
|
|
|
if ($cart_info['bl_id'] == '0') {
|
|
|
//普通商品
|
|
|
$goods_info = $model_goods->getGoodsOnlineInfoAndPromotionById($cart_info['goods_id']);
|
|
|
-
|
|
|
- //抢购
|
|
|
$logic_buy_1->getGroupbuyInfo($goods_info);
|
|
|
-
|
|
|
- //限时折扣
|
|
|
$logic_buy_1->getXianshiInfo($goods_info, $quantity);
|
|
|
|
|
|
if (intval($goods_info['goods_storage']) < $quantity) {
|