...
|
...
|
@@ -83,22 +83,22 @@ class OrderController extends HomeBaseController{ |
|
|
'price' => $price,
|
|
|
'state' => 2
|
|
|
];
|
|
|
// $this->apiResponse(200,'success',$name);
|
|
|
try{
|
|
|
Db::startTrans();
|
|
|
// try{
|
|
|
// Db::startTrans();
|
|
|
Db::name('users')->where('id',$users_id)->update(['is_use'=>0]);
|
|
|
$this->apiResponse(200,'success',$name);
|
|
|
Db::name('equipment')->where('name',$name)->update(['use'=>0]);
|
|
|
Db::name('order')->where('order_no',$order['order_no'])->update($data);
|
|
|
}catch (\Exception $exception){
|
|
|
Db::rollback();
|
|
|
$data=[
|
|
|
'state'=>false,
|
|
|
'message'=>'数据库操作失败',
|
|
|
'error' =>$exception->getMessage()
|
|
|
];
|
|
|
$this->apiResponse(200,'success',$data);
|
|
|
}
|
|
|
Db::commit();
|
|
|
// }catch (\Exception $exception){
|
|
|
// Db::rollback();
|
|
|
// $data=[
|
|
|
// 'state'=>false,
|
|
|
// 'message'=>'数据库操作失败',
|
|
|
// 'error' =>$exception->getMessage()
|
|
|
// ];
|
|
|
// $this->apiResponse(200,'success',$data);
|
|
|
// }
|
|
|
// Db::commit();
|
|
|
//调起支付
|
|
|
if ($price==0){
|
|
|
try{
|
...
|
...
|
|