Authored by yangyang

货到付款成功页面

... ... @@ -3,6 +3,7 @@
namespace Index;
use LibModels\Wap\Home\CartData;
use LibModels\Wap\Home\OrderData;
use Plugin\Helpers;
use Plugin\Images;
... ... @@ -911,4 +912,24 @@ class CartModel
return $result;
}
/**
* 支付成功页
*/
public static function paySuccessData($orderCode, $uid)
{
$result = array();
$orderInfo = OrderData::viewOrderData($orderCode, $uid, '');
if (isset($orderInfo['code']) && $orderInfo['code'] == 200 && !empty($orderInfo['data'])) {
if ($orderInfo['data']['payment_amount'] > 0) {
$result['price'] = $orderInfo['data']['payment_amount'];
}
}
$param = array('order_code'=>$orderCode);
$result['guang'] = Helpers::url('','','guang');
$result['orderDetail'] = Helpers::url('/home/orderDetail',$param);
return $result;
}
}
... ...
... ... @@ -548,11 +548,13 @@ class IndexController extends AbstractAction
// 设置网站标题
$this->setTitle('支付完成');
$this->setNavHeader('支付完成', false, false);
$data = array(
'Price' => '300',
'guang' => '1',
'orderDetail' => '2'
);
$orderCode = $this->get('order_code');
$uid = $this->getUid();
if (!$orderCode || !$uid) {
return;
}
$data = CartModel::paySuccessData($orderCode, $uid);
$this->_view->display('pay-success', $data);
}
... ...