|
@@ -256,122 +256,66 @@ class Collection extends Backend
|
|
$other_report = json_decode($params['other_report'],true);
|
|
$other_report = json_decode($params['other_report'],true);
|
|
if(count($other_report)<3){
|
|
if(count($other_report)<3){
|
|
$xianxian_score = 15-5*count($other_report)+$xianxian_score;
|
|
$xianxian_score = 15-5*count($other_report)+$xianxian_score;
|
|
- //}else{
|
|
|
|
-
|
|
|
|
-// echo '部位:'.$buwei_score.'<br/>';
|
|
|
|
-// echo '原因:'.$yuanyin_socre.'<br/>';
|
|
|
|
-// echo '方法:'.$fangfa_score.'<br/>';
|
|
|
|
|
|
+ $buwei_score = 3-1*count($other_report)+$buwei_score;
|
|
|
|
+ $yuanyin_socre = 3-1*count($other_report)+$yuanyin_socre;
|
|
|
|
+ $fangfa_score = 3-1*count($other_report)+$fangfa_score;
|
|
}
|
|
}
|
|
|
|
+
|
|
foreach ($other_report as $key => $em){
|
|
foreach ($other_report as $key => $em){
|
|
- //故障现象
|
|
|
|
- if(!in_array($em['xx_id'],$partent_fault_id)){
|
|
|
|
- $xianxian_score = 5+$xianxian_score;
|
|
|
|
- $xianxian_arr[] = $em['xx_id'];
|
|
|
|
- }
|
|
|
|
-// echo $em['yy_id']."<br>";
|
|
|
|
-
|
|
|
|
- //故障部位
|
|
|
|
- if(!empty($em['bw_id'])){
|
|
|
|
- $report_xx_id = Report::where(['bw_id'=>['in',$em['bw_id']]])->column('xx_id');
|
|
|
|
- if(!in_array($em['xx_id'],$report_xx_id)){ //现象不对,直接扣分
|
|
|
|
- $buwei_score = 1+$buwei_score;
|
|
|
|
- $buwei_arr[] = $em['bw_id'];
|
|
|
|
- echo "这里是假1的部位扣了+1分<br/>";
|
|
|
|
- }else{
|
|
|
|
- //现象正确,判断是不是正确的选项
|
|
|
|
- foreach (explode(',',$em['bw_id']) as $s => $bs){
|
|
|
|
- if(!in_array($bs,$fault_arr)){
|
|
|
|
- $buwei_score = 1+$buwei_score;
|
|
|
|
- $buwei_arr[] = $bs;
|
|
|
|
- echo "这里是假2的部位扣了+1分<br/>";
|
|
|
|
- }
|
|
|
|
|
|
+ //故障现象
|
|
|
|
+ if(!in_array($em['xx_id'],$partent_fault_id)){
|
|
|
|
+ $xianxian_score = 5+$xianxian_score;
|
|
|
|
+ $xianxian_arr[] = $em['xx_id'];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //故障部位
|
|
|
|
+ if(!empty($em['bw_id'])){
|
|
|
|
+ $report_xx_id = Report::where(['bw_id'=>['in',$em['bw_id']]])->column('xx_id');
|
|
|
|
+ if(!in_array($em['xx_id'],$report_xx_id)){ //现象不对,直接扣分
|
|
|
|
+ $buwei_score = 1+$buwei_score;
|
|
|
|
+ $buwei_arr[] = $em['bw_id'];
|
|
|
|
+ }else{
|
|
|
|
+ //现象正确,判断是不是正确的选项
|
|
|
|
+ foreach (explode(',',$em['bw_id']) as $s => $bs){
|
|
|
|
+ if(!in_array($bs,$fault_arr)){
|
|
|
|
+ $buwei_score = 1+$buwei_score;
|
|
|
|
+ $buwei_arr[] = $bs;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// $report = Report::where('bw_id',$em['bw_id'])->find();
|
|
|
|
-// if(empty($report) || $report['bw_type']==30){
|
|
|
|
-// $buwei_score = 1+$buwei_score;
|
|
|
|
-//// array_push($buwei_arr,$em['bw_id']);
|
|
|
|
-// $buwei_arr[] = $em['bw_id'];
|
|
|
|
-//// echo "这里是假的部位扣了+1分<br/>";
|
|
|
|
-// }
|
|
|
|
-// if(!empty($em['yy_id']) && !empty($report)){
|
|
|
|
-// if($report['bw_type']!=3 || $report['yy_id']!=$em['yy_id'] ){
|
|
|
|
-// $buwei_score = 1+$buwei_score;
|
|
|
|
-// echo "这里错误扣了+1分<br/>";
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- }else{
|
|
|
|
- //部位为空 +1
|
|
|
|
- $buwei_score = 1+ $buwei_score;
|
|
|
|
-// $buwei_arr[] = '';
|
|
|
|
-// echo "这里为空扣了+1分<br/>";
|
|
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ //部位为空 +1
|
|
|
|
+ $buwei_score = 1+ $buwei_score;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
- //可能原因
|
|
|
|
- if(!empty($em['yy_id'])){
|
|
|
|
- $report_bw_id = Report::where(['yy_id'=>['in',$em['yy_id']]])->column('bw_id');
|
|
|
|
- if(!in_array($em['bw_id'],$report_bw_id)){ //现象不对,直接扣分
|
|
|
|
- $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
|
- $yuanyin_arr[] = $em['yy_id'];
|
|
|
|
- }else{
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-// $report = Report::where('yy_id',$em['yy_id'])->find();
|
|
|
|
-// if(empty($report) || $report['bw_type']==30){
|
|
|
|
-// $yuanyin_socre = 1+ $yuanyin_socre;
|
|
|
|
-//// echo "这里是假的部位扣了+1分<br/>";
|
|
|
|
-//// array_push($yuanyin_arr,$em['yy_id']);
|
|
|
|
-// $yuanyin_arr[] = $em['yy_id'];
|
|
|
|
-// }
|
|
|
|
-// if(!empty($em['yy_id']) && !empty($report)){
|
|
|
|
-// if($report['bw_id']!=$em['bw_id'] ){
|
|
|
|
-// $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
|
-//// echo "这里错误扣了+1分<br/>";
|
|
|
|
-//// array_push($yuanyin_arr,$em['yy_id']);
|
|
|
|
-// $yuanyin_arr[] = $em['yy_id'];
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- }else{
|
|
|
|
- //部位为空 +1
|
|
|
|
|
|
+ //可能原因
|
|
|
|
+ if(!empty($em['yy_id'])){
|
|
|
|
+ $report_bw_id = Report::where(['yy_id'=>['in',$em['yy_id']]])->column('bw_id');
|
|
|
|
+ if(!in_array($em['bw_id'],$report_bw_id)){ //现象不对,直接扣分
|
|
$yuanyin_socre = 1+$yuanyin_socre;
|
|
$yuanyin_socre = 1+$yuanyin_socre;
|
|
-// array_push($yuanyin_arr,'');
|
|
|
|
-// echo "这里为空扣了+1分<br/>";
|
|
|
|
-// $yuanyin_arr[] = '';
|
|
|
|
- }
|
|
|
|
|
|
+ $yuanyin_arr[] = $em['yy_id'];
|
|
|
|
+ }else{
|
|
|
|
|
|
- //排除方法
|
|
|
|
- if(!empty($em['pc_id'])){
|
|
|
|
- $report_pc_id = Report::where(['pc_id'=>['in',$em['pc_id']]])->column('bw_id');
|
|
|
|
- if(!in_array($em['bw_id'],$report_pc_id)){ //现象不对,直接扣分
|
|
|
|
- $fangfa_score = 1+$fangfa_score;
|
|
|
|
- $fangfa_arr[] = $em['pc_id'];
|
|
|
|
- }else{
|
|
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ //部位为空 +1
|
|
|
|
+ $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
-// $report = Report::where('pc_id',$em['pc_id'])->find();
|
|
|
|
-// if(empty($report) || $report['bw_type']==30){
|
|
|
|
-// $fangfa_score = 1+ $fangfa_score;
|
|
|
|
-//
|
|
|
|
-// $fangfa_arr[] = $em['pc_id'];
|
|
|
|
-//// array_push($fangfa_arr,$em['pc_id']);
|
|
|
|
-//// echo "这里是假的方法扣了+1分<br/>";
|
|
|
|
-// }
|
|
|
|
-// if(!empty($em['pc_id']) && !empty($report)){
|
|
|
|
-// if($report['bw_id']!=$em['bw_id'] ){
|
|
|
|
-// $fangfa_score = 1+$fangfa_score;
|
|
|
|
-// $fangfa_arr[] = $em['pc_id'];
|
|
|
|
-//// array_push($fangfa_arr,$em['pc_id']);
|
|
|
|
-//// echo "这里错误扣了+1分<br/>";
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- }else{
|
|
|
|
|
|
+ //排除方法
|
|
|
|
+ if(!empty($em['pc_id'])){
|
|
|
|
+ $report_pc_id = Report::where(['pc_id'=>['in',$em['pc_id']]])->column('bw_id');
|
|
|
|
+ if(!in_array($em['bw_id'],$report_pc_id)){ //现象不对,直接扣分
|
|
$fangfa_score = 1+$fangfa_score;
|
|
$fangfa_score = 1+$fangfa_score;
|
|
-// array_push($yuanyin_arr,'');
|
|
|
|
-// $fangfa_arr[] = '';
|
|
|
|
-// echo "这里为空扣了+1分<br/>";
|
|
|
|
|
|
+ $fangfa_arr[] = $em['pc_id'];
|
|
|
|
+ }else{
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ $fangfa_score = 1+$fangfa_score;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// echo "<pre>";
|
|
// echo "<pre>";
|
|
// print_r($buwei_arr);
|
|
// print_r($buwei_arr);
|