Quellcode durchsuchen

流程单查询优化

qiuenguang vor 1 Jahr
Ursprung
Commit
1d35610cc8
1 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 10 1
      application/api/controller/WorkOrderVerification.php

+ 10 - 1
application/api/controller/WorkOrderVerification.php

@@ -695,12 +695,16 @@ class WorkOrderVerification extends Api
         if (!isset($params['order']) || empty($params['order'])){
             $this->error('参数错误');
         }
+        if (!isset($params['yjno']) || empty($params['yjno'])){
+            $this->error('参数错误');
+        }
         $where['Gd_gdbh'] = $params['order'];
         $where['行号'] = 1;
         //工单基本资料
         $info = db('工单_基本资料')->where($where)->field('rtrim(成品代号)  as code,rtrim(成品名称) as name')->find();
         //工艺资料
         $option['Gy0_gdbh'] = $params['order'];
+        $option['Gy0_yjno'] = $params['yjno'];
         $gyInfo = db('工单_工艺资料')
             ->where($option)
             ->where(function ($query) {
@@ -732,17 +736,22 @@ class WorkOrderVerification extends Api
         if (!isset($params['order']) || empty($params['order'])){
             $this->error('参数错误');
         }
+        if (!isset($params['yjno']) || empty($params['yjno'])){
+            $this->error('参数错误');
+        }
         if (!isset($params['gxNo']) || empty($params['gxNo'])){
             $this->error('参数错误');
         }
-        $total = db('设备_产量计酬')->where('sczl_gdbh',$params['order'])->order('sczl_num')->column('distinct(sczl_num)');
+        $total = db('设备_产量计酬')->where('sczl_gdbh',$params['order'])->where('sczl_gdbh',$params['yjno'])->order('sczl_num')->column('distinct(sczl_num)');
         $where['sczl_gxh'] = (int)$params['gxNo'];
         $where['sczl_gdbh'] = $params['order'];
+        $where['sczl_yjno'] = $params['yjno'];
         //机器设备数据
         $process = db('设备_产量计酬')->where($where)->order('sczl_num')->column('distinct(sczl_num)');
         //手工数据
         $option['qczl_gdbh'] = $params['order'];
         $option['qczl_gxh'] = (int)$params['gxNo'];
+        $option['qczl_yjno'] = $params['yjno'];
         $handProcess = db('db_qczl')->where($option)->field('qczl_num,qczl_NumDesc1,qczl_NumDesc2,qczl_NumDesc3,qczl_NumDesc4,qczl_NumDesc5,qczl_NumDesc6,qczl_NumDesc7,qczl_NumDesc8')->select();
         // 提取数据
         $result = array();