作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

... ... @@ -98,6 +98,11 @@ class OrderController extends HomeBaseController{
Db::commit();
//调起支付
if ($price==0){
try{
Db::name('order')->where(['order_no'=>$order['order_no']])->update(['state'=>3]);
}catch (\Exception $exception){
$this->apiResponse(301,'error:'.$exception->getMessage());
}
$data=[
'state'=>2,
];
... ... @@ -226,7 +231,7 @@ class OrderController extends HomeBaseController{
$order=Db::name('order')->where(['order_no'=>$order_no,'state'=>2])->find();
$openId=Db::name('users')->where('id',$order['users_id'])->find()['open_id'];
$body='支付';
$price=$order['price'];//订单价格
$price=$order['price']*1;//订单价格
$notify_url=url('order/notify','','',true);//回调地址
$out_trade_no=$order_no.$this->create_noncestr(4);
$wxPay=new WeixinPay($openId,$out_trade_no,$body,$price,$notify_url);
... ...
... ... @@ -103,7 +103,6 @@ class WeixinPay {
private function weixinapp() {
//统一下单接口
$unifiedorder = $this->unifiedorder();
dump($unifiedorder);
$parameters = array(
'appId' => $this->appid, //小程序ID
'timeStamp' => ''.time().'', //时间戳
... ...