|
@@ -11,10 +11,9 @@ class buy_1Logic
|
|
|
* 取得商品最新的属性及促销[购物车]
|
|
|
* @param unknown $cart_list
|
|
|
*/
|
|
|
- public function getGoodsCartList($cart_list) {
|
|
|
-
|
|
|
+ public function getGoodsCartList($cart_list)
|
|
|
+ {
|
|
|
$cart_list = $this->_getOnlineCartList($cart_list);
|
|
|
-
|
|
|
//优惠套装
|
|
|
$this->_getBundlingCartList($cart_list);
|
|
|
//抢购
|
|
@@ -25,7 +24,6 @@ class buy_1Logic
|
|
|
$this->_getGiftCartList($cart_list);
|
|
|
|
|
|
return $cart_list;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -34,15 +32,13 @@ class buy_1Logic
|
|
|
* @param int $quantity
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getGoodsOnlineInfo($goods_id,$quantity) {
|
|
|
+ public function getGoodsOnlineInfo($goods_id,$quantity)
|
|
|
+ {
|
|
|
$goods_info = $this->_getGoodsOnlineInfo($goods_id,$quantity);
|
|
|
-
|
|
|
//抢购
|
|
|
$this->getGroupbuyInfo($goods_info);
|
|
|
-
|
|
|
//限时折扣
|
|
|
$this->getXianshiInfo($goods_info,$goods_info['goods_num']);
|
|
|
-
|
|
|
//赠品
|
|
|
$this->_getGoodsGiftList($goods_info);
|
|
|
|
|
@@ -429,7 +425,6 @@ class buy_1Logic
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
$new_data = array();
|
|
|
$new_data['buyer_id'] = $member_id;
|
|
|
$new_data['store_id'] = $store_id;
|
|
@@ -949,7 +944,8 @@ class buy_1Logic
|
|
|
$goods_online_array[$goods['goods_id']] = $goods;
|
|
|
}
|
|
|
|
|
|
- foreach ((array)$cart_list as $key => $cart_info) {
|
|
|
+ foreach ((array)$cart_list as $key => $cart_info)
|
|
|
+ {
|
|
|
if (intval($cart_info['bl_id'])) continue;
|
|
|
$cart_list[$key]['state'] = true;
|
|
|
$cart_list[$key]['storage_state'] = true;
|
|
@@ -1039,7 +1035,8 @@ class buy_1Logic
|
|
|
* 取得购买车内组合销售信息以及包含的商品及有效状态
|
|
|
* @param array $cart_list
|
|
|
*/
|
|
|
- private function _getBundlingCartList(& $cart_list) {
|
|
|
+ private function _getBundlingCartList(& $cart_list)
|
|
|
+ {
|
|
|
if (!C('promotion_allow') || empty($cart_list)) return ;
|
|
|
$model_bl = Model('p_bundling');
|
|
|
$model_goods = Model('goods');
|
|
@@ -1104,7 +1101,8 @@ class buy_1Logic
|
|
|
* @param array $store_premiums_list 赠品列表
|
|
|
* @return array 商品ID=>库存
|
|
|
*/
|
|
|
- private function _getEachGoodsStorageQuantity($store_cart_list, $store_premiums_list = array()) {
|
|
|
+ private function _getEachGoodsStorageQuantity($store_cart_list, $store_premiums_list = array())
|
|
|
+ {
|
|
|
if(empty($store_cart_list) || !is_array($store_cart_list)) return array();
|
|
|
$goods_storage_quangity = array();
|
|
|
foreach ($store_cart_list as $store_cart) {
|
|
@@ -1120,8 +1118,10 @@ class buy_1Logic
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//取得赠品商品的库存
|
|
|
- if (is_array($store_premiums_list)) {
|
|
|
+ if (is_array($store_premiums_list))
|
|
|
+ {
|
|
|
foreach ($store_premiums_list as $store_id => $goods_list) {
|
|
|
foreach($goods_list as $goods_info) {
|
|
|
if (!isset($goods_storage_quangity[$goods_info['goods_id']])) {
|