code review by hf: do fixes bug to refs YW-1947 modify pay action check order is…
… pay do redirect order detail page
Showing
2 changed files
with
6 additions
and
0 deletions
@@ -800,6 +800,11 @@ class HomeController extends AbstractAction | @@ -800,6 +800,11 @@ class HomeController extends AbstractAction | ||
800 | $this->error(); | 800 | $this->error(); |
801 | } | 801 | } |
802 | 802 | ||
803 | + /* 判断订单是否已付款, 已付款跳到订单详情页 */ | ||
804 | + if (!empty($orderDetail['isPay'])) { | ||
805 | + $this->go(Helpers::url('/home/orderdetail', array('order_code' => $orderCode)) ); | ||
806 | + } | ||
807 | + | ||
803 | $hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; | 808 | $hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; |
804 | if ($hasWxShare) { | 809 | if ($hasWxShare) { |
805 | $tools = new JsApiPay(); | 810 | $tools = new JsApiPay(); |
@@ -152,6 +152,7 @@ class OrderModel | @@ -152,6 +152,7 @@ class OrderModel | ||
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 | $result['orderCount'] = $count; // 订单总件数 |
155 | + $result['isPay'] = $orderDetail['data']['payment_status'] === 'Y'; | ||
155 | } | 156 | } |
156 | } | 157 | } |
157 | 158 |
-
Please register or login to post a comment