Authored by hf

code review by hf: do add analysis code

@@ -98,4 +98,38 @@ @@ -98,4 +98,38 @@
98 {{/ orderDetail}} 98 {{/ orderDetail}}
99 </div> 99 </div>
100 <script>_ozprm="orderid={{orderCode}}&ordertotal={{orderTotal}}";</script> 100 <script>_ozprm="orderid={{orderCode}}&ordertotal={{orderTotal}}";</script>
  101 +<script type="text/javascript" src ="http://static.yohobuy.com/m/v1/js/AG_Tracking.js"></script>
  102 +<script type="text/javascript">
  103 +var _agq = _agq || [];
  104 +_agq.push(['_cid', '415']); //生成value
  105 +_agq.push(['_eid', '102']); //生成value
  106 +_agq.push(['_orderSum',"{{orderTotal}}"]);//订单金额,客户在页面填写
  107 +_agq.push(['_orderNo',"{{orderCode}}"]);//订单号,客户在页面填写
  108 +_agq.push(['_orderNew',"{{isOldUser}}"]);//是否新客单,客户标记是为true否为false
  109 +_agq.push(['_orderCount',"{{orderCount}}"]);//订单货品数目,客户填写
  110 +ag_send(_agq);
  111 +
  112 +var __order_code = "{{orderCode}}";
  113 +var __order_amount = "{{orderTotal}}";
  114 +var __order_user = "{{isOldUser}}";
  115 +var __order_goods_num = {{orderCount}};
  116 +var __order_uid = '{{uid}}';
  117 +
  118 +var _fxcmd=_fxcmd||[];
  119 +_fxcmd.push(['trackOrder', {
  120 + oid: "{{orderCode}}",
  121 + otp : "{{orderTotalFormat}}",
  122 + unid : "{{uid}}"
  123 +}]);
  124 +</script>
  125 +<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
  126 +<script type="text/javascript">
  127 +window.criteo_q = window.criteo_q || [];
  128 +window.criteo_q.push(
  129 +{ event: "setAccount", account: [21397] },
  130 +{ event: "setHashedEmail", email: "" },
  131 +{ event: "setSiteType", type: "m" },
  132 +{ event: "trackTransaction" , id: "{{orderCode}}", currency: "CNY", item: ""}
  133 +);
  134 +</script>
101 {{> layout/footer}} 135 {{> layout/footer}}
@@ -33,5 +33,39 @@ @@ -33,5 +33,39 @@
33 </div> 33 </div>
34 </div> 34 </div>
35 <script>_ozprm="orderid={{orderCode}}&ordertotal={{orderTotal}}";</script> 35 <script>_ozprm="orderid={{orderCode}}&ordertotal={{orderTotal}}";</script>
  36 +<script type="text/javascript" src ="http://static.yohobuy.com/m/v1/js/AG_Tracking.js"></script>
  37 +<script type="text/javascript">
  38 +var _agq = _agq || [];
  39 +_agq.push(['_cid', '415']); //生成value
  40 +_agq.push(['_eid', '102']); //生成value
  41 +_agq.push(['_orderSum',"{{orderTotal}}"]);//订单金额,客户在页面填写
  42 +_agq.push(['_orderNo',"{{orderCode}}"]);//订单号,客户在页面填写
  43 +_agq.push(['_orderNew',"{{isOldUser}}"]);//是否新客单,客户标记是为true否为false
  44 +_agq.push(['_orderCount',"{{orderCount}}"]);//订单货品数目,客户填写
  45 +ag_send(_agq);
  46 +
  47 +var __order_code = "{{orderCode}}";
  48 +var __order_amount = "{{orderTotal}}";
  49 +var __order_user = "{{isOldUser}}";
  50 +var __order_goods_num = {{orderCount}};
  51 +var __order_uid = '{{uid}}';
  52 +
  53 +var _fxcmd=_fxcmd||[];
  54 +_fxcmd.push(['trackOrder', {
  55 + oid: "{{orderCode}}",
  56 + otp : "{{orderTotalFormat}}",
  57 + unid : "{{uid}}"
  58 +}]);
  59 +</script>
  60 +<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
  61 +<script type="text/javascript">
  62 +window.criteo_q = window.criteo_q || [];
  63 +window.criteo_q.push(
  64 +{ event: "setAccount", account: [21397] },
  65 +{ event: "setHashedEmail", email: "" },
  66 +{ event: "setSiteType", type: "m" },
  67 +{ event: "trackTransaction" , id: "{{orderCode}}", currency: "CNY", item: ""}
  68 +);
  69 +</script>
36 {{> layout/footer}} 70 {{> layout/footer}}
37 71
@@ -793,7 +793,7 @@ class HomeController extends AbstractAction @@ -793,7 +793,7 @@ class HomeController extends AbstractAction
793 if (empty($orderCode)) { 793 if (empty($orderCode)) {
794 $this->error(); 794 $this->error();
795 } 795 }
796 - 796 +
797 /* 判断订单信息是否存在 */ 797 /* 判断订单信息是否存在 */
798 $orderDetail = OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession); 798 $orderDetail = OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession);
799 if (empty($orderDetail)) { 799 if (empty($orderDetail)) {
@@ -832,6 +832,10 @@ class HomeController extends AbstractAction @@ -832,6 +832,10 @@ class HomeController extends AbstractAction
832 'hasWxShare' => $hasWxShare, 832 'hasWxShare' => $hasWxShare,
833 'orderCode' => $orderCode, 833 'orderCode' => $orderCode,
834 'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0, 834 'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0,
  835 + 'orderTotalFormat' => isset($orderDetail['goodsAmount']) ? sprintf("%d", $orderDetail['goodsAmount']) : 0,
  836 + 'orderCount' => isset($orderDetail['orderCount']) ? $orderDetail['orderCount'] : 0,
  837 + 'isOldUser' => (isset($_COOKIE['_isOldUser']) && $_COOKIE['_isOldUser'] == '4') ? 'true' : 'false',
  838 + 'uid' => $this->_uid,
835 )); 839 ));
836 } 840 }
837 841
@@ -927,6 +931,10 @@ class HomeController extends AbstractAction @@ -927,6 +931,10 @@ class HomeController extends AbstractAction
927 'orderDetail' => $orderDetail, 931 'orderDetail' => $orderDetail,
928 'orderCode' => $orderCode, 932 'orderCode' => $orderCode,
929 'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0, 933 'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0,
  934 + 'orderTotalFormat' => isset($orderDetail['goodsAmount']) ? sprintf("%d", $orderDetail['goodsAmount']) : 0,
  935 + 'orderCount' => isset($orderDetail['orderCount']) ? intval($orderDetail['orderCount']) : 0,
  936 + 'isOldUser' => (isset($_COOKIE['_isOldUser']) && $_COOKIE['_isOldUser'] == '4') ? 'true' : 'false',
  937 + 'uid' => $this->_uid,
930 )); 938 ));
931 } 939 }
932 940
@@ -151,6 +151,7 @@ class OrderModel @@ -151,6 +151,7 @@ class OrderModel
151 $result['yohoCoin'] = $orderDetail['data']['yoho_coin_num']; // YOHO币 151 $result['yohoCoin'] = $orderDetail['data']['yoho_coin_num']; // YOHO币
152 $result['price'] = $orderDetail['data']['amount']; // 实付金额 152 $result['price'] = $orderDetail['data']['amount']; // 实付金额
153 $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号 153 $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号
  154 + $result['orderCount'] = $count; // 订单总件数
154 } 155 }
155 } 156 }
156 157