作者 魏强
1 个管道 的构建 通过 耗费 0 秒

Merge branch 'master' of http://114.215.101.231:8099/root/sleep

@@ -111,9 +111,11 @@ class AdminFaultAuditController extends AdminBaseController{ @@ -111,9 +111,11 @@ class AdminFaultAuditController extends AdminBaseController{
111 try{ 111 try{
112 Db::startTrans(); 112 Db::startTrans();
113 Db::name('users')->where('id',$fault['users_id'])->update(['is_use'=>0]); 113 Db::name('users')->where('id',$fault['users_id'])->update(['is_use'=>0]);
114 - Db::name('equipment')->where('name',$order['eq_name'])->update(['use'=>0]);  
115 Db::name('order')->where('id',$order['id'])->update($data); 114 Db::name('order')->where('id',$order['id'])->update($data);
116 Db::name('fault')->where('id',$id)->update(['state'=>3]); 115 Db::name('fault')->where('id',$id)->update(['state'=>3]);
  116 +// if (!Db::name('order')->where(['eq_name'=>$order['eq_name'],'state'=>1])->find()){
  117 + Db::name('equipment')->where('name',$order['eq_name'])->update(['use'=>0]);
  118 +// }
117 }catch (\Exception $exception){ 119 }catch (\Exception $exception){
118 Db::rollback(); 120 Db::rollback();
119 $this->error('错误:'.$exception->getMessage()); 121 $this->error('错误:'.$exception->getMessage());
@@ -579,6 +579,10 @@ class OrderController extends HomeBaseController{ @@ -579,6 +579,10 @@ class OrderController extends HomeBaseController{
579 */ 579 */
580 public function pay($order_no){ 580 public function pay($order_no){
581 $order = Db::name('order')->where(['order_no' => $order_no, 'state' => 2])->find(); 581 $order = Db::name('order')->where(['order_no' => $order_no, 'state' => 2])->find();
  582 + if ($order['price']==0){
  583 + Db::name('order')->where(['id'=>$order['id']])->update(['state'=>3]);
  584 + $this->apiResponse(200, '订单结算成功');
  585 + }
582 $user = Db::name('users')->where('id', $order['users_id'])->find(); 586 $user = Db::name('users')->where('id', $order['users_id'])->find();
583 $price = $order['price'] * 100;//订单价格 587 $price = $order['price'] * 100;//订单价格
584 //微信直接支付 588 //微信直接支付