Authored by Rock Zhang

添加品友统计需要的有关数据

@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 <script> 2 <script>
3 <script> 3 <script>
4 !function(w,d,e){ 4 !function(w,d,e){
5 -var _orderno='{{orderNo}}';  
6 -var _money='{{money}}'; 5 +var _orderno='{{orderNum}}';
  6 +var _money='{{count}}';
7 var _productList='{{productList}}'; 7 var _productList='{{productList}}';
8 var b=location.href,c=d.referrer,f,s,g=d.cookie,h=g.match(/(^|;)\s*ipycookie=([^;]*)/),i=g.match(/(^|;)\s*ipysession=([^;]*)/);if (w.parent!=w){f=b;b=c;c=f;};u='//stats.ipinyou.com/cvt?a='+e('MC.2z.Rg-AQqSqQi2GykX12LUxI0')+'&c='+e(h?h[2]:'')+'&s='+e(i?i[2].match(/jump\%3D(\d+)/)[1]:'')+'&u='+e(b)+'&r='+e(c)+'&rd='+(new Date()).getTime()+'&OrderNo='+e(_orderno)+'&Money='+e(_money)+'&ProductList='+e(_productList)+'&e='; 8 var b=location.href,c=d.referrer,f,s,g=d.cookie,h=g.match(/(^|;)\s*ipycookie=([^;]*)/),i=g.match(/(^|;)\s*ipysession=([^;]*)/);if (w.parent!=w){f=b;b=c;c=f;};u='//stats.ipinyou.com/cvt?a='+e('MC.2z.Rg-AQqSqQi2GykX12LUxI0')+'&c='+e(h?h[2]:'')+'&s='+e(i?i[2].match(/jump\%3D(\d+)/)[1]:'')+'&u='+e(b)+'&r='+e(c)+'&rd='+(new Date()).getTime()+'&OrderNo='+e(_orderno)+'&Money='+e(_money)+'&ProductList='+e(_productList)+'&e=';
9 function _(){if(!d.body){setTimeout(_(),100);}else{s= d.createElement('script');s.src = u;d.body.insertBefore(s,d.body.firstChild);}}_(); 9 function _(){if(!d.body){setTimeout(_(),100);}else{s= d.createElement('script');s.src = u;d.body.insertBefore(s,d.body.firstChild);}}_();
@@ -66,6 +66,30 @@ class PayModel @@ -66,6 +66,30 @@ class PayModel
66 $result['count'] = $order['payment_amount']; 66 $result['count'] = $order['payment_amount'];
67 $result['paymentType'] = ($order['payment_type'] == 1 ? '在线支付' : '货到付款'); 67 $result['paymentType'] = ($order['payment_type'] == 1 ? '在线支付' : '货到付款');
68 68
  69 + //统计成交的skn
  70 + $sknList = array();
  71 + $skuList = array();
  72 + $goodsData = array();
  73 + $pinyouGoodsArr = array();
  74 + foreach ($order['order_goods'] as $val) {
  75 + $sknList[] = $val['product_skn'];
  76 + $skuList[] = $val['product_sku'];
  77 + $goodsData[] = array(
  78 + 'goods_name' => $val['product_name'],
  79 + 'product_sku' => $val['product_sku'],
  80 + 'price' => $val['goods_price'],
  81 + 'number' => $val['buy_number']
  82 + );
  83 + $pinyouGoodsArr[] = $val['product_id'] . ',' . $val['buy_number'];
  84 + }
  85 + $result['goodsData'] = $goodsData;
  86 + // skn列表
  87 + $result['sknList'] = implode(',', $sknList);
  88 + // sku列表
  89 + $result['skuList'] = implode(',', $skuList);
  90 + // 品友统计需要的商品数据
  91 + $result['pinyouGoods'] = implode(';', $pinyouGoodsArr);
  92 +
69 // 货到付款的情况 93 // 货到付款的情况
70 if ($order['payment_type'] == 2) { 94 if ($order['payment_type'] == 2) {
71 $result['finish'] = true; 95 $result['finish'] = true;
@@ -88,26 +112,6 @@ class PayModel @@ -88,26 +112,6 @@ class PayModel
88 112
89 $result['deliveryType'] =isset($order['delivery_time']) ? $order['delivery_time'] : ''; 113 $result['deliveryType'] =isset($order['delivery_time']) ? $order['delivery_time'] : '';
90 114
91 - //统计成交的skn  
92 - $sknList = array();  
93 - $skuList = array();  
94 - $goodsData = array();  
95 - foreach ($order['order_goods'] as $val) {  
96 - $sknList[] = $val['product_skn'];  
97 - $skuList[] = $val['product_sku'];  
98 - $goodsData[] = array(  
99 - 'goods_name' => $val['product_name'],  
100 - 'product_sku' => $val['product_sku'],  
101 - 'price' => $val['goods_price'],  
102 - 'number' => $val['buy_number']  
103 - );  
104 - }  
105 - $result['goodsData'] = $goodsData;  
106 - // skn列表  
107 - $result['sknList'] = implode(',', $sknList);  
108 - // sku列表  
109 - $result['skuList'] = implode(',', $skuList);  
110 -  
111 // 用户ID 115 // 用户ID
112 $result['uid'] = $uid; 116 $result['uid'] = $uid;
113 117
@@ -220,7 +224,6 @@ class PayModel @@ -220,7 +224,6 @@ class PayModel
220 $result['orderGoods'] = $order['order_goods']; 224 $result['orderGoods'] = $order['order_goods'];
221 // 订单商品数(用于订单统计) 225 // 订单商品数(用于订单统计)
222 $result['ordersGoodsNums'] = count($order['order_goods']); 226 $result['ordersGoodsNums'] = count($order['order_goods']);
223 -  
224 } while (false); 227 } while (false);
225 228
226 return $result; 229 return $result;
@@ -64,6 +64,11 @@ class PayController extends WebAction @@ -64,6 +64,11 @@ class PayController extends WebAction
64 $this->setSimpleHeader(); 64 $this->setSimpleHeader();
65 $this->_view->display($view, array( 65 $this->_view->display($view, array(
66 'shoppingpay' =>$data, 66 'shoppingpay' =>$data,
  67 + 'pinyou' => array(
  68 + 'orderNum' => $data['orderNum'],
  69 + 'count' => $data['count'],
  70 + 'productList' => $data['pinyouGoods']
  71 + ),
67 'payPage' => true 72 'payPage' => true
68 )); 73 ));
69 } 74 }