...
|
...
|
@@ -47,6 +47,44 @@ class AdminFaultController extends AdminBaseController{ |
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
//保修
|
|
|
public function warranty(){
|
|
|
$id=$this->request->param('id');
|
|
|
|
|
|
$fault=Db::name('fault')->where('id',$id)->find();
|
|
|
|
|
|
try{
|
|
|
Db::startTrans();
|
|
|
Db::name('equipment')->where('name',$fault['eq_name'])->update(['state'=>2]);
|
|
|
Db::name('fault')->where('id',$id)->update(['state'=>2]);
|
|
|
}catch (\Exception $exception){
|
|
|
Db::rollback();
|
|
|
$this->error('错误:'.$exception->getMessage());
|
|
|
}
|
|
|
Db::commit();
|
|
|
$this->success('处理完成');
|
|
|
|
|
|
}
|
|
|
|
|
|
//恢复设备
|
|
|
public function reply(){
|
|
|
$id=$this->request->param('id');
|
|
|
|
|
|
$fault=Db::name('fault')->where('id',$id)->find();
|
|
|
|
|
|
try{
|
|
|
Db::startTrans();
|
|
|
Db::name('equipment')->where('name',$fault['eq_name'])->update(['state'=>1]);
|
|
|
Db::name('fault')->where('id',$id)->update(['state'=>3]);
|
|
|
}catch (\Exception $exception){
|
|
|
Db::rollback();
|
|
|
$this->error('错误:'.$exception->getMessage());
|
|
|
}
|
|
|
Db::commit();
|
|
|
$this->success('处理完成');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//结束计费
|
|
|
public function bill_error(){
|
...
|
...
|
|