Parcourir la source

Merge branch 'master' of https://git.7in6.com/Minong/mes-server-api

曹鹤洋 il y a 1 an
Parent
commit
e68f588d90

+ 7 - 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,15 @@ 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.状态' => '',
+                    'b.PD_WG' => '1900-01-01 00:00:00',
                 ])
-                ->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{

+ 1 - 0
application/api/controller/WorkOrder.php

@@ -263,6 +263,7 @@ class WorkOrder extends Api
                     '计划产量' => (int)($value['Gy0_计划接货数']/$value['Gy0_ls']),
                     '基础损耗' => rtrim($value['Gy0_Rate0']),
                     '损耗率' => rtrim($value['Gy0_Rate1']),
+                    '机台编号' => rtrim($value['Gy0_sbbh']),
                     '报废定额' => $scrap,
                     '允损比例' => $number,
                     '难度系数' => isset($value['工价系数'])?rtrim($value['工价系数']):'',