Authored by whb

Merge branch 'temp'

@@ -88,12 +88,12 @@ class Service extends PayAbstract @@ -88,12 +88,12 @@ class Service extends PayAbstract
88 88
89 $rsp = new Rspparams(); 89 $rsp = new Rspparams();
90 // 支付成功 90 // 支付成功
91 - if(array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS"){ 91 + if(isset($result['trade_state']) && $result['trade_state'] === 'SUCCESS'){
92 $rsp->payResult = 200; 92 $rsp->payResult = 200;
93 $rsp->bankName = "WX"; 93 $rsp->bankName = "WX";
94 $rsp->orderCode = $data['orderCode']; 94 $rsp->orderCode = $data['orderCode'];
95 $rsp->payTime = $result["time_end"]; 95 $rsp->payTime = $result["time_end"];
96 - $rsp->totalFee = $result["total_fee"]; 96 + $rsp->totalFee = $result["total_fee"] / 100;
97 $rsp->resultMsg = '支付成功'; 97 $rsp->resultMsg = '支付成功';
98 //添加支付订单号和交易号 98 //添加支付订单号和交易号
99 $rsp->payOrderCode = $data["orderCode"]; 99 $rsp->payOrderCode = $data["orderCode"];
@@ -70,7 +70,7 @@ class InfoModel @@ -70,7 +70,7 @@ class InfoModel
70 { 70 {
71 $result = array(); 71 $result = array();
72 //推荐商品列表 72 //推荐商品列表
73 - $goods = array(); 73 + $goods = $goodsGroup = array();
74 $result['pathNav'] = self::getCenterCrumb($article['article_title'], $channel); 74 $result['pathNav'] = self::getCenterCrumb($article['article_title'], $channel);
75 //文章头部信息 75 //文章头部信息
76 $result['header']['title'] = $article['article_title']; 76 $result['header']['title'] = $article['article_title'];
@@ -88,10 +88,12 @@ class InfoModel @@ -88,10 +88,12 @@ class InfoModel
88 if (isset($data['contents']) && !empty($data['contents'])) { 88 if (isset($data['contents']) && !empty($data['contents'])) {
89 foreach ($data['contents'] as $key => $val) { 89 foreach ($data['contents'] as $key => $val) {
90 foreach ($val as $type => $con) { 90 foreach ($val as $type => $con) {
91 - if ($type != 'goods') {  
92 - $result['content'][] = is_callable("self::$type") ? self::$type($con['data']) : '';  
93 - } else { 91 + if ($type === 'goods') {
94 $goods = array_merge_recursive($goods, self::goods($con['data'])); 92 $goods = array_merge_recursive($goods, self::goods($con['data']));
  93 + } elseif ($type === 'goodsGroup') {
  94 + $goodsGroup = array_merge_recursive($goodsGroup, self::goodsGroup($con['data']));
  95 + } else {
  96 + $result['content'] = is_callable("self::$type") ? self::$type($con['data']) : '';
95 } 97 }
96 } 98 }
97 } 99 }
@@ -99,6 +101,9 @@ class InfoModel @@ -99,6 +101,9 @@ class InfoModel
99 if (!empty($goods)) { 101 if (!empty($goods)) {
100 $result['content'][] = array('relatedReco'=>array('recos'=>$goods)); 102 $result['content'][] = array('relatedReco'=>array('recos'=>$goods));
101 } 103 }
  104 + if (!empty($goodsGroup)) {
  105 + $result['content']['relatedReco'] = $goodsGroup;
  106 + }
102 //赞、收藏 107 //赞、收藏
103 if (isset($data['baseInfo']) && !empty($data['baseInfo'])) { 108 if (isset($data['baseInfo']) && !empty($data['baseInfo'])) {
104 $result['userInfo']['isLike'] = $data['baseInfo']['isPraise'] == 'Y' ? true : false; 109 $result['userInfo']['isLike'] = $data['baseInfo']['isPraise'] == 'Y' ? true : false;
@@ -182,20 +187,21 @@ class InfoModel @@ -182,20 +187,21 @@ class InfoModel
182 */ 187 */
183 public static function goodsGroup($goodsGroup) 188 public static function goodsGroup($goodsGroup)
184 { 189 {
185 - $result = $groupSkn = $productSkn = array(); 190 + $result = $groupSkn = array();
186 foreach ($goodsGroup as $key => $val) { 191 foreach ($goodsGroup as $key => $val) {
187 if (!isset($val['list']) || empty($val['list'])) { 192 if (!isset($val['list']) || empty($val['list'])) {
188 continue; 193 continue;
189 } 194 }
  195 + $productSkn = array();
190 foreach ($val['list'] as $k => $v) { 196 foreach ($val['list'] as $k => $v) {
191 $groupSkn[$key][] = $v['id']; 197 $groupSkn[$key][] = $v['id'];
192 $productSkn[] = $v['id']; 198 $productSkn[] = $v['id'];
193 } 199 }
194 - }  
195 - if (!empty($productSkn)) {  
196 - $product = SearchData::searchElasticByCondition(array('query' => implode(',', $productSkn)));  
197 - if (isset($product['data']['product_list'])) {  
198 - $result['relatedReco']['recos'] = array_slice(self::formatProduct($product['data']['product_list']), 0, 4); 200 + if (!empty($productSkn)) {
  201 + $product = SearchData::searchElasticByCondition(array('query' => implode(',', $productSkn)));
  202 + if (isset($product['data']['product_list'])) {
  203 + $result[$key]['recos'] = array_slice(self::formatProduct($product['data']['product_list']), 0, 4);
  204 + }
199 } 205 }
200 } 206 }
201 return $result; 207 return $result;
@@ -428,9 +428,9 @@ class PayModel @@ -428,9 +428,9 @@ class PayModel
428 $tradeNo = 'YOHOBuy_' . $orderCode; 428 $tradeNo = 'YOHOBuy_' . $orderCode;
429 $input = new WxPayOrderQuery(); 429 $input = new WxPayOrderQuery();
430 $input->SetOut_trade_no($tradeNo); 430 $input->SetOut_trade_no($tradeNo);
431 - $result = WxPayApi::orderQuery($input); 431 + $payResult = WxPayApi::orderQuery($input);
432 432
433 - if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") { 433 + if (isset($payResult['trade_state']) && $payResult['trade_state'] === 'SUCCESS') {
434 $result = array( 434 $result = array(
435 'code' => '200', 435 'code' => '200',
436 'message' => 'success' 436 'message' => 'success'