|
@@ -47,6 +47,44 @@ class AdminFaultController extends AdminBaseController{ |
|
@@ -47,6 +47,44 @@ class AdminFaultController extends AdminBaseController{ |
47
|
return $this->fetch();
|
47
|
return $this->fetch();
|
48
|
}
|
48
|
}
|
49
|
|
49
|
|
|
|
50
|
+ //保修
|
|
|
51
|
+ public function warranty(){
|
|
|
52
|
+ $id=$this->request->param('id');
|
|
|
53
|
+
|
|
|
54
|
+ $fault=Db::name('fault')->where('id',$id)->find();
|
|
|
55
|
+
|
|
|
56
|
+ try{
|
|
|
57
|
+ Db::startTrans();
|
|
|
58
|
+ Db::name('equipment')->where('name',$fault['eq_name'])->update(['state'=>2]);
|
|
|
59
|
+ Db::name('fault')->where('id',$id)->update(['state'=>2]);
|
|
|
60
|
+ }catch (\Exception $exception){
|
|
|
61
|
+ Db::rollback();
|
|
|
62
|
+ $this->error('错误:'.$exception->getMessage());
|
|
|
63
|
+ }
|
|
|
64
|
+ Db::commit();
|
|
|
65
|
+ $this->success('处理完成');
|
|
|
66
|
+
|
|
|
67
|
+ }
|
|
|
68
|
+
|
|
|
69
|
+ //恢复设备
|
|
|
70
|
+ public function reply(){
|
|
|
71
|
+ $id=$this->request->param('id');
|
|
|
72
|
+
|
|
|
73
|
+ $fault=Db::name('fault')->where('id',$id)->find();
|
|
|
74
|
+
|
|
|
75
|
+ try{
|
|
|
76
|
+ Db::startTrans();
|
|
|
77
|
+ Db::name('equipment')->where('name',$fault['eq_name'])->update(['state'=>1]);
|
|
|
78
|
+ Db::name('fault')->where('id',$id)->update(['state'=>3]);
|
|
|
79
|
+ }catch (\Exception $exception){
|
|
|
80
|
+ Db::rollback();
|
|
|
81
|
+ $this->error('错误:'.$exception->getMessage());
|
|
|
82
|
+ }
|
|
|
83
|
+ Db::commit();
|
|
|
84
|
+ $this->success('处理完成');
|
|
|
85
|
+
|
|
|
86
|
+ }
|
|
|
87
|
+
|
50
|
|
88
|
|
51
|
//结束计费
|
89
|
//结束计费
|
52
|
public function bill_error(){
|
90
|
public function bill_error(){
|