Jelajahi Sumber

排程工单

qiuenguang 1 tahun lalu
induk
melakukan
5a202286be
1 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 6 6
      application/api/controller/Manufacture.php

+ 6 - 6
application/api/controller/Manufacture.php

@@ -170,7 +170,7 @@ class Manufacture extends Api
             $this->error('参数错误');
         }
         $where = '';
-        if (isset($param['search'])){
+        if (!empty($param['search'])){
             $where = "
                         a.Gd_gdbh LIKE '%{$param['search']}%' 
                         OR a.`成品名称` LIKE '%{$param['search']}%' 
@@ -197,14 +197,14 @@ class Manufacture extends Api
                 ->where([
                     'a.gd_statu' => '2-生产中',
                     'a.行号' => '1',
-                    'b.PD_WG' => '1900-01-01 00:00:00',
-                    'b.Gy0_sj1' => '1900-01-01 00:00:00',
                     'c.状态' => '',
                 ])
-                ->where("
-                        b.Gy0_sj1 <> '1900-01-01 00:00:00' 
-                    ")
                 ->where($where)
+                ->whereNotExists(function ($query) {
+                    $query->table('工单_工艺资料')->alias('b2')
+                        ->where('b2.Gy0_gdbh = a.Gd_gdbh')
+                        ->where('b2.Gy0_sj1 <> "1900-01-01 00:00:00"');
+                })
                 ->group('a.Gd_gdbh')
                 ->select();
         }else{