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

add stop equipment

@@ -132,15 +132,12 @@ class AdminEquipmentController extends AdminBaseController{ @@ -132,15 +132,12 @@ class AdminEquipmentController extends AdminBaseController{
132 $map['state']=1; 132 $map['state']=1;
133 $order=\db('order')->where($map)->find(); 133 $order=\db('order')->where($map)->find();
134 /*结束订单*/ 134 /*结束订单*/
135 - dump($order); 135 +
136 $data['end_time']=time(); 136 $data['end_time']=time();
137 $info['price']=action('Order/onlyGetPrice',[$order['users_id'],$order['start_time'],time()]); 137 $info['price']=action('Order/onlyGetPrice',[$order['users_id'],$order['start_time'],time()]);
138 - dump($info);  
139 - exit;  
140 $data['state']=2; 138 $data['state']=2;
141 $data['price']=$info['price']; 139 $data['price']=$info['price'];
142 - $data['time']=$info['time'];  
143 - 140 + $data['time']=ceil((time()-$order['start_time'])/3600);
144 Db::startTrans(); 141 Db::startTrans();
145 try{ 142 try{
146 Db::name('equipment')->where('id',$id)->update(['use'=>0]); 143 Db::name('equipment')->where('id',$id)->update(['use'=>0]);