Explorar el Código

机台工单搜索

qiuenguang hace 1 año
padre
commit
08c680bf71
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      application/api/controller/Manufacture.php

+ 9 - 1
application/api/controller/Manufacture.php

@@ -412,7 +412,7 @@ class Manufacture extends Api
             'Gy0_gxh'  => $data['processCode']
         ];
         $result = \db('工单_工艺资料')->where($where)->field('rtrim(Gy0_sj1) as sj1')->find();
-        if ($result['sj1']>'1900-01-01 00:00:00'){
+        if ($result['sj1'] != '1900-01-01 00:00:00'){
             $this->error('该工单已经是制程中');
         }
         $lastTime = \db('工单_工艺资料')
@@ -748,6 +748,13 @@ class Manufacture extends Api
         if (empty($param)){
             $this->error('参数错误');
         }
+        $where = '';
+        if (isset($param['search'])){
+            $where = "
+                        a.Gd_gdbh LIKE '%{$param['search']}%' 
+                        OR a.`成品名称` LIKE '%{$param['search']}%' 
+                    ";
+        }
         $list = \db('工单_基本资料')
             ->alias('a')
             ->field([
@@ -790,6 +797,7 @@ class Manufacture extends Api
                 'b.Gy0_sbbh' => ['LIKE','%'.$param['machine'].'%'],
                 'b.PD_WG' => '1900-01-01 00:00:00'
             ])
+            ->where($where)
             ->group('a.Gd_gdbh')
             ->select();
         if (empty($list)){