...
|
...
|
@@ -228,7 +228,7 @@ class OrderController extends HomeBaseController{ |
|
|
$body='支付';
|
|
|
$price=$order['price'];//订单价格
|
|
|
$notify_url=url('order/notify','','',true);//回调地址
|
|
|
$out_trade_no=$order_no.rand(1000,9999);
|
|
|
$out_trade_no=$order_no.$this->create_noncestr(4);
|
|
|
$wxPay=new WeixinPay($openId,$out_trade_no,$body,$price,$notify_url);
|
|
|
$pay=$wxPay->pay();
|
|
|
if (isset($pay['package'])){
|
...
|
...
|
@@ -277,4 +277,13 @@ class OrderController extends HomeBaseController{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
function create_noncestr($length = 4){
|
|
|
$chars = "0123456789";
|
|
|
$str = "";
|
|
|
for($i=0;$i<$length;$i++){
|
|
|
$str.= substr($chars,mt_rand(0,strlen($chars)-1),1);
|
|
|
}
|
|
|
return $str;
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|