...
|
...
|
@@ -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);
|
...
|
...
|
|