Ver Fonte

换型清场记录

qiuenguang há 1 ano atrás
pai
commit
1cafbaf296
1 ficheiros alterados com 6 adições e 3 exclusões
  1. 6 3
      application/api/controller/Facility.php

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

@@ -961,9 +961,10 @@ class Facility extends Api
         if (empty($list)){
             $this->error('失败');
         }
-        $sql = "SELECT RTRIM(a.`设备编号`) as `设备编号`,RTRIM(b.`日期`) as `日期`,RTRIM(b.UniqId) as UniqId FROM `设备_基本资料` as a 
+        $sql = "SELECT RTRIM(a.`设备编号`) as `设备编号`,RTRIM(b.`日期`) as `日期`,RTRIM(b.UniqId) as UniqId 
+                FROM `设备_基本资料` as a 
                 LEFT JOIN `制程_换型清场` as b ON b.`机台编号` = a.`设备编号`
-                WHERE b.`日期` > '{$date}' AND b.日期 < '{$nowTime}' ORDER BY b.`UniqId`";
+                WHERE b.`日期` > '{$date}' AND b.日期 < '{$nowTime}' AND b.`工单编号A` <> '' AND b.`工单编号B` <> '' ORDER BY b.`UniqId`";
         $res = Db::query($sql);
         $data = $result = [];
         foreach ($list as $key=>$value){
@@ -1047,7 +1048,9 @@ class Facility extends Api
         $nowTime = date('Y-m-d H:i:s',time());
         $where = [
             '日期' =>['between',[$date,$nowTime]],
-            '机台编号' => $param['machine']
+            '机台编号' => $param['machine'],
+            '工单编号A' => ['<>',''],
+            '工单编号B' => ['<>',''],
         ];
         $field = "rtrim(日期) as 日期,rtrim(机台编号) as 机台编号,rtrim(班组) as 班组,rtrim(工单编号A) as 工单编号A,rtrim(印件工序A) as 印件工序A,
         rtrim(码包号A) as 码包号A,rtrim(工单编号B) as 工单编号B,rtrim(印件工序B) as 印件工序B,rtrim(码包号B) as 码包号B,rtrim(清场项目A) as 清场项目A,