...
|
...
|
@@ -11,6 +11,7 @@ namespace app\portal\controller; |
|
|
|
|
|
use app\portal\model\EquipmentModel;
|
|
|
use cmf\controller\AdminBaseController;
|
|
|
use app\portal\Controller\OrderController;
|
|
|
use PHPExcel;
|
|
|
use PHPExcel_IOFactory;
|
|
|
use PHPExcel_Style_Alignment;
|
...
|
...
|
@@ -123,6 +124,29 @@ class AdminEquipmentController extends AdminBaseController{ |
|
|
$this->success('删除成功');
|
|
|
}
|
|
|
|
|
|
public function unUse(){
|
|
|
/*解除设备占用*/
|
|
|
$id=$this->request->param('id');
|
|
|
|
|
|
$eq=Db::name('equipment')->where('id',$id)->find();
|
|
|
|
|
|
dump($eq);
|
|
|
/*查找对应订单*/
|
|
|
$map['eq_name']=$eq['name'];
|
|
|
$order=\db('order')->where($map)->find();
|
|
|
//Db::name('equipment')->where('id',$id)->update(['use'=>0]);
|
|
|
/*结束订单*/
|
|
|
$data['end_time']=time();
|
|
|
$Order=new OrderController();
|
|
|
$data['price']= $Order->getPrice($order['users_id'],$order['start_time'],time());
|
|
|
dump($data);
|
|
|
|
|
|
// \db('order')->where($map)->update();
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//批量导入设备信息
|
|
|
public function batch_add(){
|
...
|
...
|
|