Sfoglia il codice sorgente

获取检品机废品率系数

qiuenguang 1 anno fa
parent
commit
ef4cd89410
1 ha cambiato i file con 26 aggiunte e 0 eliminazioni
  1. 26 0
      application/api/controller/ReportingWork.php

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

@@ -666,4 +666,30 @@ class ReportingWork extends Api
         ];
         $this->success('成功',$data);
     }
+
+    /**检品机获取废品率系数
+     * @return void
+     */
+    public function getRejectRate()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (!isset($param['order']) || !isset($param['yjno']) || !isset($param['gxh']) || !isset($param['type'])){
+            $this->error('参数错误');
+        }
+        if ($param['type'] === ''){
+            $param['type'] = '次品板';
+        }
+        if ($param['type'] === '废品板'){
+            $param['type'] = '废检';
+        }
+        $res = \db('工单_工艺资料')
+            ->where('Gy0_gdbh',$param['order'])
+            ->where('Gy0_yjno',$param['yjno'])
+            ->where('Gy0_gxh',$param['gxh'])
+            ->column('机检_'.$param['type'])[0];
+        $this->success('成功',$res);
+    }
 }