Authored by hf

do fixes some bugs

@@ -633,11 +633,13 @@ class Helpers @@ -633,11 +633,13 @@ class Helpers
633 633
634 $gift = array(); 634 $gift = array();
635 $oneGoods = array(); 635 $oneGoods = array();
  636 + $number = 0;
636 foreach ($advanceGoods as $value) { 637 foreach ($advanceGoods as $value) {
637 $gift = array(); 638 $gift = array();
638 $gift['promotionId'] = $value['promotion_id']; 639 $gift['promotionId'] = $value['promotion_id'];
639 $gift['promotionTitle'] = $value['promotion_title']; 640 $gift['promotionTitle'] = $value['promotion_title'];
640 641
  642 + $number = 0;
641 foreach ($value['goods_list'] as $single) { 643 foreach ($value['goods_list'] as $single) {
642 $oneGoods = array(); 644 $oneGoods = array();
643 $oneGoods['id'] = $single['product_skn']; 645 $oneGoods['id'] = $single['product_skn'];
@@ -648,12 +650,14 @@ class Helpers @@ -648,12 +650,14 @@ class Helpers
648 $oneGoods['count'] = $single['storage_number']; 650 $oneGoods['count'] = $single['storage_number'];
649 651
650 $gift['goods'][] = $oneGoods; 652 $gift['goods'][] = $oneGoods;
  653 + $number ++;
651 } 654 }
652 655
653 $arr[] = $gift; 656 $arr[] = $gift;
654 657
655 // 计算加价购商品数目 658 // 计算加价购商品数目
656 - $count += count($value['goods_list']); 659 + //$count += count($value['goods_list']);
  660 + $count += $number;
657 } 661 }
658 662
659 return $arr; 663 return $arr;
@@ -38,9 +38,10 @@ var _hmt = _hmt || []; @@ -38,9 +38,10 @@ var _hmt = _hmt || [];
38 window._py = window._py||[]; 38 window._py = window._py||[];
39 window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']); 39 window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']);
40 window._py.push(['domain','stats.ipinyou.com']); 40 window._py.push(['domain','stats.ipinyou.com']);
41 - if(typeof _goodsData!='undefined')  
42 - window._py.push(['pi',_goodsData]);  
43 window._py.push(['e','']); 41 window._py.push(['e','']);
  42 + if(typeof _goodsData!='undefined'){
  43 + window._py.push(['pi',_goodsData]);
  44 + }
44 -function(d){ 45 -function(d){
45 var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1; 46 var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1;
46 c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js'; 47 c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js';
@@ -325,7 +325,7 @@ class CartModel @@ -325,7 +325,7 @@ class CartModel
325 $pay = CartData::cartPay($uid, $cartType); 325 $pay = CartData::cartPay($uid, $cartType);
326 326
327 // 商品为空返回 327 // 商品为空返回
328 - if (!$pay || (isset($pay['data']['goods_list']) && empty($pay['data']['goods_list']))) { 328 + if (!$pay || empty($pay['data']['goods_list'])) {
329 $result['cartUrl'] = Helpers::url('/cart/index/index'); 329 $result['cartUrl'] = Helpers::url('/cart/index/index');
330 return $result; 330 return $result;
331 } 331 }