Browse Source

设备作业清单

15168162575 1 year ago
parent
commit
f6b8c3af79
1 changed files with 5 additions and 3 deletions
  1. 5 3
      application/api/controller/Facility.php

+ 5 - 3
application/api/controller/Facility.php

@@ -362,9 +362,12 @@ class Facility extends Api
         $data = \db('设备_产量采集')->where('设备编号',$machine)->order('UniqId desc')->find();
         foreach ($orderList as $key=>$value){
             $orderList[$key]['status'] = 0;
-            if ($value['gdbh'] === $data['工单编号'] && $value['yjno'] === $data['印件号'] && $value['gxh'] === $data['工序号']) {
-                $orderList[$key]['status'] = 1;
+            if (!empty($data)){
+                if ($value['gdbh'] === $data['工单编号'] && $value['yjno'] === $data['印件号'] && $value['gxh'] === $data['工序号']) {
+                    $orderList[$key]['status'] = 1;
+                }
             }
+
             $orderList[$key]['工单编号|质量信息'] = $value['gdbh'].'|'.$value['质量信息'];
             $orderList[$key]['印件号'] = $value['yjno'];
             $orderList[$key]['工序号'] = $value['gxh'];
@@ -473,7 +476,6 @@ class Facility extends Api
             for ($i=1;$i<11;$i++){
                 if ($v['bh'.$i] != '' && $v['bh'.$i] != '000000'){
                     $name = \db('人事_基本资料')->where('员工编号',$v['bh'.$i])->field('rtrim(员工姓名) as 姓名')->find();
-                    var_dump($v['ID']);
                     if ($v['rate'.$i] > 0){
                         $data[$k][$i-1] = $v['bh'.$i].' '.$name['姓名'].' ('.number_format($v['rate'.$i]*100,2).'%'.')';
                     }else{