|
@@ -117,7 +117,7 @@ class Collection extends Backend
|
|
|
$this->exam_model->save($arr);
|
|
|
|
|
|
//考试和故障关联表
|
|
|
- $fault_list = fault::where(['sim_type' => $row->sim_type, 'fault_state' => 0,'fault_type'=>3])->select();
|
|
|
+ $fault_list = Fault::where(['sim_type' => $row->sim_type, 'fault_state' => 0,'fault_type'=>3])->select();
|
|
|
$fault_key = array_rand($fault_list, 3);
|
|
|
foreach ($fault_list as $key=> $item){
|
|
|
$flag = 0;
|
|
@@ -275,9 +275,20 @@ class Collection extends Backend
|
|
|
$departmentdata = [];
|
|
|
$departmentdata = Fault::where(['replace_part'=>1])->select();
|
|
|
|
|
|
+ //更换件数据
|
|
|
$this->view->assign('departmentdata', $departmentdata);
|
|
|
-// echo "<pre>";
|
|
|
-// print_r(collection($departmentdata)->toArray());
|
|
|
+
|
|
|
+ //故障现象
|
|
|
+ $xianxiang = Fault::where(['fault_type'=>1,'sim_type'=>$row->sim_type])->select();
|
|
|
+ $this->view->assign('xianxiang', $xianxiang);
|
|
|
+ //可能原因
|
|
|
+ $yuanyin = Fault::where(['fault_type'=>2,'sim_type'=>$row->sim_type])->select();
|
|
|
+ $this->view->assign('yuanyin', $yuanyin);
|
|
|
+ //故障部位
|
|
|
+ $buwei = Fault::where(['fault_type'=>3,'sim_type'=>$row->sim_type])->select();
|
|
|
+ $this->view->assign('yuanyin', $yuanyin);
|
|
|
+ //排除方法
|
|
|
+ $paichu = Fault::where(['fault_type'=>4,'sim_type'=>$row->sim_type])->select();
|
|
|
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
@@ -308,7 +319,7 @@ class Collection extends Backend
|
|
|
$add = [
|
|
|
'exam_id'=>$ids,
|
|
|
'fault_id'=>$item['fault_id'],
|
|
|
- 'fault_name'=>Fault::where('fault_id',$item['fault_id'])->value('replace_name'),
|
|
|
+ 'fault_name'=>Db::name('fault')->where('fault_id',$item['fault_id'])->value('replace_name'),
|
|
|
'request_status'=>$isreplace['request_status'],
|
|
|
'create_by_user_id'=>$this->auth->id,
|
|
|
'create_by'=>$this->auth->nickname,
|