Sfoglia il codice sorgente

检品机定额代号获取

qiuenguang 1 anno fa
parent
commit
d4b3e7c426

+ 42 - 7
application/api/controller/MachineProductionReport.php

@@ -725,10 +725,13 @@ class MachineProductionReport extends Api
     }
 
     /**
-     * 查询定额代号
-     * @ApiMethod (GET)
+     * 检品机定额代号获取
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
      */
-    public function getDedh()
+    public function JPgetDedh()
     {
         //get请求
         if(!$this->request->isGet()){
@@ -740,11 +743,11 @@ class MachineProductionReport extends Api
         }
         if(!empty($req['sczl_jtbh'])){
             $row = db('dic_lzde')
-            ->field('sys_bh,Key_')
-            ->where('适用机型',$req['sczl_jtbh'])
-            ->find();
+                ->field('sys_bh,Key_')
+                ->where('适用机型',$req['sczl_jtbh'])
+                ->find();
             $list = db('dic_lzde')
-                ->field('sys_bh')
+                ->field('sys_bh,rtrim(sys_mc)')
                 ->where('Parent',$row['Key_'])
                 ->select();
             if (empty($list)){
@@ -754,6 +757,38 @@ class MachineProductionReport extends Api
             }
 
         }
+    }
+
+    /**
+     * 查询定额代号
+     * @ApiMethod (GET)
+     */
+    public function getDedh()
+    {
+        //get请求
+        if(!$this->request->isGet()){
+            $this->error('请求方式错误');
+        }
+        $req = $this->request->param();
+        if (!isset($req['sczl_jtbh'])){
+            $this->error('参数错误');
+        }
+        if(!empty($req['sczl_jtbh'])){
+            $row = db('dic_lzde')
+            ->field('sys_bh,Key_,rtrim(sys_mc)')
+            ->where('适用机型',$req['sczl_jtbh'])
+            ->find();
+//            $list = db('dic_lzde')
+//                ->field('sys_bh')
+//                ->where('Parent',$row['Key_'])
+//                ->select();
+//            if (empty($list)){
+                $this->success('成功',$row);
+//            }else{
+//                $this->success('成功',$list);
+//            }
+
+        }
 
         $row = db('dic_lzde')
             ->field('Key_, sys_bh, rtrim(sys_mc) as sys_mc')

+ 1 - 1
application/api/controller/PackagingCountDocument.php

@@ -101,7 +101,7 @@ class PackagingCountDocument extends Api
             sczl_cl1 + sczl_cl2 + sczl_cl3 + sczl_cl4 + sczl_cl5 + sczl_cl6 as sczl_cl, 
             sczl_返工产量1 + sczl_返工产量2 + sczl_返工产量3 + sczl_返工产量4 + sczl_返工产量5 + sczl_返工产量6 as sczl_fgsl, 
             sczl_cl1 + sczl_cl2 + sczl_cl3 + sczl_cl4 + sczl_cl5 + sczl_cl6 + sczl_返工产量1 + sczl_返工产量2 + sczl_返工产量3 + sczl_返工产量4 + sczl_返工产量5 + sczl_返工产量6 as sczl_jjcl, 
-            sczl_gdbh1, rtrim(sys_id) as sys_id, sys_rq, mod_rq, UniqId')
+            sczl_gdbh1,sczl_type1, rtrim(sys_id) as sys_id, sys_rq, mod_rq, UniqId')
             ->where($where)
             ->page($page,$limit)
             ->select();