Authored by yangyang

货到付款成功页面

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace Index; 3 namespace Index;
4 4
5 use LibModels\Wap\Home\CartData; 5 use LibModels\Wap\Home\CartData;
  6 +use LibModels\Wap\Home\OrderData;
6 use Plugin\Helpers; 7 use Plugin\Helpers;
7 use Plugin\Images; 8 use Plugin\Images;
8 9
@@ -911,4 +912,24 @@ class CartModel @@ -911,4 +912,24 @@ class CartModel
911 return $result; 912 return $result;
912 } 913 }
913 914
  915 + /**
  916 + * 支付成功页
  917 + */
  918 + public static function paySuccessData($orderCode, $uid)
  919 + {
  920 + $result = array();
  921 + $orderInfo = OrderData::viewOrderData($orderCode, $uid, '');
  922 +
  923 + if (isset($orderInfo['code']) && $orderInfo['code'] == 200 && !empty($orderInfo['data'])) {
  924 + if ($orderInfo['data']['payment_amount'] > 0) {
  925 + $result['price'] = $orderInfo['data']['payment_amount'];
  926 + }
  927 + }
  928 + $param = array('order_code'=>$orderCode);
  929 + $result['guang'] = Helpers::url('','','guang');
  930 + $result['orderDetail'] = Helpers::url('/home/orderDetail',$param);
  931 +
  932 + return $result;
  933 + }
  934 +
914 } 935 }
@@ -548,11 +548,13 @@ class IndexController extends AbstractAction @@ -548,11 +548,13 @@ class IndexController extends AbstractAction
548 // 设置网站标题 548 // 设置网站标题
549 $this->setTitle('支付完成'); 549 $this->setTitle('支付完成');
550 $this->setNavHeader('支付完成', false, false); 550 $this->setNavHeader('支付完成', false, false);
551 - $data = array(  
552 - 'Price' => '300',  
553 - 'guang' => '1',  
554 - 'orderDetail' => '2'  
555 - ); 551 + $orderCode = $this->get('order_code');
  552 + $uid = $this->getUid();
  553 + if (!$orderCode || !$uid) {
  554 + return;
  555 + }
  556 + $data = CartModel::paySuccessData($orderCode, $uid);
  557 +
556 $this->_view->display('pay-success', $data); 558 $this->_view->display('pay-success', $data);
557 } 559 }
558 560