瀏覽代碼

排程工单

qiuenguang 1 年之前
父節點
當前提交
5a202286be
共有 1 個文件被更改,包括 6 次插入6 次删除
  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{