qiuenguang 1 жил өмнө
parent
commit
e5165819ee

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

@@ -100,8 +100,8 @@ class Facility extends Api
         $machineDetail = \db('设备_基本资料')->where('设备编号',$machine)->field('rtrim(千件工价) as 千件工价,rtrim(日定额) as 日定额')->find();
         //组员信息
         $list = \db('设备_产量计酬')->where($where)->field($field)->select();
-        $totalA = \db('设备_产量计酬')->where($where)->where('sczl_bzdh','A班')->field('SUM(sczl_cl) as 产量')->select();
-        $totalB = \db('设备_产量计酬')->where($where)->where('sczl_bzdh','B班')->field('SUM(sczl_cl) as 产量')->select();
+        $totalA = \db('设备_产量计酬')->where($where)->where('sczl_bzdh','like','A%')->field('SUM(sczl_cl) as 产量')->select();
+        $totalB = \db('设备_产量计酬')->where($where)->where('sczl_bzdh','like','B%')->field('SUM(sczl_cl) as 产量')->select();
         if (empty($list)){
             $this->success('',[]);
         }

+ 4 - 0
application/api/controller/ReportingWork.php

@@ -342,6 +342,10 @@ class ReportingWork extends Api
             $this->error('非法请求');
         }
         $params = Request::instance()->post();
+        $time = date('Y-m-d 08:30:00',time()-86400);
+        if ($params['sczl_sj2']<date('Y-m-d 08:30:00',time()) && $params['sczl_sj2']>date('Y-m-d 00:00:00')){
+            $params['sczl_rq'] = $time;
+        }
         $machine = $params['sczl_jtbh'].'#';
         $batchData = []; //批次追踪数据
         $batch = $params['bom'];