曹鹤洋 1 жил өмнө
parent
commit
f3261ea941

+ 12 - 6
application/api/controller/FinishedProductWarehousing.php

@@ -32,18 +32,18 @@ class FinishedProductWarehousing extends Api
             $this->error('请求方式错误');
         }
         $rows = db('成品入仓')
-            ->field('LEFT(sys_rq, 10) as date, COUNT(*) as counts')
+            ->field('LEFT(Sys_rq, 10) as date, COUNT(*) as counts')
             ->group('date')
             ->order('UniqId desc')
             ->limit(50)
             ->select();
 
         $num = db('成品入仓')
-            ->where('sys_rq','>=',$rows[count($rows)-1]['date'])
+            ->where('Sys_rq','>=',$rows[count($rows)-1]['date'])
             ->count();
         $arr = db('成品入仓')
-            ->field('LEFT(sys_rq, 10) as date, rtrim(sys_id) as sys_id, COUNT(*) as count')
-            ->where('sys_rq','>=',$rows[count($rows)-1]['date'])
+            ->field('LEFT(Sys_rq, 10) as date, rtrim(sys_id) as sys_id, COUNT(*) as count')
+            ->where('Sys_rq','>=',$rows[count($rows)-1]['date'])
             ->group('date, sys_id')
             ->limit($num)
             ->select();
@@ -369,6 +369,12 @@ class FinishedProductWarehousing extends Api
             ->join(['产品_印件资料'=>'j'],'g.Gd_cpdh=j.yj_yjdh and g.成品代号=j.yj_cpdh')
             ->order('j.yj_yjno asc')
             ->select();
+        // $rows = db()->table('工单_印件资料')->alias('j')
+        //     ->field('g.Gd_gdbh, j.yj_Yjno as yj_yjno, rtrim(g.销售订单号) as 销售订单号, rtrim(j.yj_Yjdh) as yj_Yjdh, 
+        //     rtrim(j.yj_yjmc) as yj_yjmc, rtrim(g.成品代号) as 成品代号, rtrim(g.成品名称) as 成品名称, rtrim(g.客户料号) as 客户料号')
+        //     ->where(['g.Gd_gdbh'=>$gdbh])
+        //     ->join(['工单_基本资料'=>'g'],'g.Gd_gdbh=j.Yj_Gdbh')
+        //     ->select();
 
         foreach ($rows as $key=>$value){
             $rows[$key]['gdyj'] =  $value['Gd_gdbh'].' -'.sprintf("%02d", $value['yj_yjno']).'-'.$value['yj_yjmc'];
@@ -1127,8 +1133,8 @@ class FinishedProductWarehousing extends Api
 
 
         // $rows = db('db_包装产量预报')
-        //     ->field('sczl_rq,sczl_gdbh1,sczl_gdbh2,sczl_gdbh3,sczl_gdbh4,sczl_gdbh5,sczl_gdbh6,sys_rq,mod_rq,UniqId')
-        //     ->where('sys_rq','>=','2023-10-25')
+        //     ->field('sczl_rq,sczl_gdbh1,sczl_gdbh2,sczl_gdbh3,sczl_gdbh4,sczl_gdbh5,sczl_gdbh6,Sys_rq,mod_rq,UniqId')
+        //     ->where('Sys_rq','>=','2023-10-25')
         //     ->select();
         // $uniqueValues = [];
         // foreach ($rows as $row) {