|
@@ -1,11 +1,6 @@
|
|
<?php
|
|
<?php
|
|
/**
|
|
/**
|
|
* 我的购物车
|
|
* 我的购物车
|
|
- *
|
|
|
|
- *
|
|
|
|
- *
|
|
|
|
- *
|
|
|
|
-
|
|
|
|
*/
|
|
*/
|
|
|
|
|
|
//use Shopnc\Tpl;
|
|
//use Shopnc\Tpl;
|
|
@@ -33,9 +28,14 @@ class cartControl extends mobileControl
|
|
|
|
|
|
//购物车列表 [得到最新商品属性及促销信息]
|
|
//购物车列表 [得到最新商品属性及促销信息]
|
|
$cart_list = $logic_buy_1->getGoodsCartList($cart_list);
|
|
$cart_list = $logic_buy_1->getGoodsCartList($cart_list);
|
|
|
|
+ if(count($cart_list) == 0) {
|
|
|
|
+ return self::outsuccess(array('carts' => NULL,'mobile_page' => 0));
|
|
|
|
+ }
|
|
|
|
+
|
|
$ret = array_chunk($cart_list,$this->page_size());
|
|
$ret = array_chunk($cart_list,$this->page_size());
|
|
$pages = count($ret);
|
|
$pages = count($ret);
|
|
- $cart_list = $ret[$this->page_no() - 1];
|
|
|
|
|
|
+ $page_no = $pages >= $this->page_no() ? $this->page_no() : $pages;
|
|
|
|
+ $cart_list = $ret[$page_no - 1];
|
|
|
|
|
|
//购物车商品以店铺ID分组显示,并计算商品小计,店铺小计与总价由JS计算得出
|
|
//购物车商品以店铺ID分组显示,并计算商品小计,店铺小计与总价由JS计算得出
|
|
$store_cart_list = array();
|
|
$store_cart_list = array();
|
|
@@ -46,7 +46,7 @@ class cartControl extends mobileControl
|
|
}
|
|
}
|
|
|
|
|
|
//店铺信息
|
|
//店铺信息
|
|
- $store_list = Model('store')->getStoreMemberIDList(array_keys($store_cart_list));
|
|
|
|
|
|
+ $store_list = Model('store')->getStoreMemberIDList(array_keys($store_cart_list),'store_id,member_id,store_name');
|
|
//取得店铺级活动 - 可用的满即送活动
|
|
//取得店铺级活动 - 可用的满即送活动
|
|
$mansong_rule_list = $logic_buy_1->getMansongRuleList(array_keys($store_cart_list));
|
|
$mansong_rule_list = $logic_buy_1->getMansongRuleList(array_keys($store_cart_list));
|
|
//取得哪些店铺有满免运费活动
|
|
//取得哪些店铺有满免运费活动
|
|
@@ -69,7 +69,7 @@ class cartControl extends mobileControl
|
|
"image_url","xianshi_recommend");
|
|
"image_url","xianshi_recommend");
|
|
static $ex_gbuyfield = array("groupbuy_id","goods_id","goods_commonid","goods_name","store_id","store_name","goods_price","recommended","views",
|
|
static $ex_gbuyfield = array("groupbuy_id","goods_id","goods_commonid","goods_name","store_id","store_name","goods_price","recommended","views",
|
|
"class_id","s_class_id","is_vr","vr_city_id","vr_area_id","vr_mall_id","vr_class_id","vr_s_class_id","groupbuy_url","goods_url","start_time_text",
|
|
"class_id","s_class_id","is_vr","vr_city_id","vr_area_id","vr_mall_id","vr_class_id","vr_s_class_id","groupbuy_url","goods_url","start_time_text",
|
|
- "end_time_text","groupbuy_state_text","reviewable","cancelable","state_flag","button_text","count_down_text","count_down");
|
|
|
|
|
|
+ "end_time_text","groupbuy_state_text","reviewable","cancelable","state_flag","button_text","count_down_text","count_down","groupbuy_intro");
|
|
|
|
|
|
|
|
|
|
if(is_array($goods_info))
|
|
if(is_array($goods_info))
|
|
@@ -527,9 +527,9 @@ class cartControl extends mobileControl
|
|
|
|
|
|
$ret = $this->do_del($cart_id);
|
|
$ret = $this->do_del($cart_id);
|
|
if($ret) {
|
|
if($ret) {
|
|
- return self::outerr(errcode::ErrCartDelError);
|
|
|
|
- } else {
|
|
|
|
return self::outsuccess(array('result' => '1'));
|
|
return self::outsuccess(array('result' => '1'));
|
|
|
|
+ } else {
|
|
|
|
+ return self::outerr(errcode::ErrCartDelError);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|