|
@@ -98,6 +98,11 @@ class OrderController extends HomeBaseController{ |
|
@@ -98,6 +98,11 @@ class OrderController extends HomeBaseController{ |
98
|
Db::commit();
|
98
|
Db::commit();
|
99
|
//调起支付
|
99
|
//调起支付
|
100
|
if ($price==0){
|
100
|
if ($price==0){
|
|
|
101
|
+ try{
|
|
|
102
|
+ Db::name('order')->where(['order_no'=>$order['order_no']])->update(['state'=>3]);
|
|
|
103
|
+ }catch (\Exception $exception){
|
|
|
104
|
+ $this->apiResponse(301,'error:'.$exception->getMessage());
|
|
|
105
|
+ }
|
101
|
$data=[
|
106
|
$data=[
|
102
|
'state'=>2,
|
107
|
'state'=>2,
|
103
|
];
|
108
|
];
|
|
@@ -226,7 +231,7 @@ class OrderController extends HomeBaseController{ |
|
@@ -226,7 +231,7 @@ class OrderController extends HomeBaseController{ |
226
|
$order=Db::name('order')->where(['order_no'=>$order_no,'state'=>2])->find();
|
231
|
$order=Db::name('order')->where(['order_no'=>$order_no,'state'=>2])->find();
|
227
|
$openId=Db::name('users')->where('id',$order['users_id'])->find()['open_id'];
|
232
|
$openId=Db::name('users')->where('id',$order['users_id'])->find()['open_id'];
|
228
|
$body='支付';
|
233
|
$body='支付';
|
229
|
- $price=$order['price'];//订单价格
|
234
|
+ $price=$order['price']*1;//订单价格
|
230
|
$notify_url=url('order/notify','','',true);//回调地址
|
235
|
$notify_url=url('order/notify','','',true);//回调地址
|
231
|
$out_trade_no=$order_no.$this->create_noncestr(4);
|
236
|
$out_trade_no=$order_no.$this->create_noncestr(4);
|
232
|
$wxPay=new WeixinPay($openId,$out_trade_no,$body,$price,$notify_url);
|
237
|
$wxPay=new WeixinPay($openId,$out_trade_no,$body,$price,$notify_url);
|