Browse Source

当班产量明细

qiuenguang 1 year ago
parent
commit
b412aec94b
1 changed files with 7 additions and 2 deletions
  1. 7 2
      application/api/controller/Facility.php

+ 7 - 2
application/api/controller/Facility.php

@@ -508,11 +508,16 @@ class Facility extends Api
         if (empty($machine) || empty($team)){
             $this->success('');
         }
-        $sczlTime = date('Y-m-d 00:00:00',time());
+        $sczlTime = date('Y-m-d H:i:s',time());
+        if ($sczlTime>date('Y-m-d 00:00:00') && $sczlTime<date('Y-m-d 08:30:00')){
+            $time = date('Y-m-d 00:00:00',time()-86400);
+        }else{
+            $time = date('Y-m-d 00:00:00');
+        }
         $where = [
             'sczl_jtbh' => $machine,
             'sczl_bzdh' => ['like',$team.'%'],
-            'sczl_rq' => $sczlTime,
+            'sczl_rq' => $time,
         ];
         $field = 'rtrim(sczl_gdbh) as 工单编号,rtrim(sczl_yjno) as yjno,rtrim(sczl_num) as 流程单号,rtrim(sczl_dedh) as dedh,rtrim(sczl_gxmc) as gxmc,rtrim(sczl_num) as 标牌号,rtrim(sczl_cl) as 产量,
         rtrim(sczl_zcfp) as 制程废品,rtrim(sczl_zccp) as 制程次品,rtrim(sczl_前工序废) as 前工序废,rtrim(sczl_来料少数) as 来料异常,rtrim(sczl_装版工时) as 装版工时,