Authored by whb

Merge branch 'temp'

... ... @@ -88,12 +88,12 @@ class Service extends PayAbstract
$rsp = new Rspparams();
// 支付成功
if(array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS"){
if(isset($result['trade_state']) && $result['trade_state'] === 'SUCCESS'){
$rsp->payResult = 200;
$rsp->bankName = "WX";
$rsp->orderCode = $data['orderCode'];
$rsp->payTime = $result["time_end"];
$rsp->totalFee = $result["total_fee"];
$rsp->totalFee = $result["total_fee"] / 100;
$rsp->resultMsg = '支付成功';
//添加支付订单号和交易号
$rsp->payOrderCode = $data["orderCode"];
... ...
... ... @@ -70,7 +70,7 @@ class InfoModel
{
$result = array();
//推荐商品列表
$goods = array();
$goods = $goodsGroup = array();
$result['pathNav'] = self::getCenterCrumb($article['article_title'], $channel);
//文章头部信息
$result['header']['title'] = $article['article_title'];
... ... @@ -88,10 +88,12 @@ class InfoModel
if (isset($data['contents']) && !empty($data['contents'])) {
foreach ($data['contents'] as $key => $val) {
foreach ($val as $type => $con) {
if ($type != 'goods') {
$result['content'][] = is_callable("self::$type") ? self::$type($con['data']) : '';
} else {
if ($type === 'goods') {
$goods = array_merge_recursive($goods, self::goods($con['data']));
} elseif ($type === 'goodsGroup') {
$goodsGroup = array_merge_recursive($goodsGroup, self::goodsGroup($con['data']));
} else {
$result['content'] = is_callable("self::$type") ? self::$type($con['data']) : '';
}
}
}
... ... @@ -99,6 +101,9 @@ class InfoModel
if (!empty($goods)) {
$result['content'][] = array('relatedReco'=>array('recos'=>$goods));
}
if (!empty($goodsGroup)) {
$result['content']['relatedReco'] = $goodsGroup;
}
//赞、收藏
if (isset($data['baseInfo']) && !empty($data['baseInfo'])) {
$result['userInfo']['isLike'] = $data['baseInfo']['isPraise'] == 'Y' ? true : false;
... ... @@ -182,20 +187,21 @@ class InfoModel
*/
public static function goodsGroup($goodsGroup)
{
$result = $groupSkn = $productSkn = array();
$result = $groupSkn = array();
foreach ($goodsGroup as $key => $val) {
if (!isset($val['list']) || empty($val['list'])) {
continue;
}
$productSkn = array();
foreach ($val['list'] as $k => $v) {
$groupSkn[$key][] = $v['id'];
$productSkn[] = $v['id'];
}
}
if (!empty($productSkn)) {
$product = SearchData::searchElasticByCondition(array('query' => implode(',', $productSkn)));
if (isset($product['data']['product_list'])) {
$result['relatedReco']['recos'] = array_slice(self::formatProduct($product['data']['product_list']), 0, 4);
$result[$key]['recos'] = array_slice(self::formatProduct($product['data']['product_list']), 0, 4);
}
}
}
return $result;
... ...
... ... @@ -428,9 +428,9 @@ class PayModel
$tradeNo = 'YOHOBuy_' . $orderCode;
$input = new WxPayOrderQuery();
$input->SetOut_trade_no($tradeNo);
$result = WxPayApi::orderQuery($input);
$payResult = WxPayApi::orderQuery($input);
if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
if (isset($payResult['trade_state']) && $payResult['trade_state'] === 'SUCCESS') {
$result = array(
'code' => '200',
'message' => 'success'
... ...