Ver código fonte

糊盒成品入仓优化

unknown 3 meses atrás
pai
commit
c1c0b91516

+ 34 - 0
application/api/controller/GluFinishedProductWarehousing.php

@@ -343,4 +343,38 @@ class GluFinishedProductWarehousing extends Api
         $this->success('成功');
 
     }
+
+
+    /**
+     * 获取工单信息
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function getGd()
+    {
+        //get请求
+        if(!$this->request->isGet()){
+            $this->error('请求方式错误');
+        }
+        $req = $this->request->param();
+        if (isset($req['gdbh']) && !empty($req['gdbh'])){
+            $gdbh = $req['gdbh'];
+        }else{
+            $this->error('参数错误');
+        }
+
+        $rows = db('工单_基本资料')
+            ->field('Gd_gdbh, rtrim(销售订单号) as 销售订单号, rtrim(Gd_cpdh) as yj_Yjdh, 
+            rtrim(Gd_cpmc) as yj_yjmc, rtrim(成品代号) as 成品代号, rtrim(成品名称) as 成品名称, 
+            rtrim(客户料号) as 客户料号,行号')
+            ->where(['Gd_gdbh'=>$gdbh])
+            ->select();
+        foreach ($rows as $key=>$value){
+            $rows[$key]['gdyj'] =  $value['Gd_gdbh'].' -'.$value['行号'].'-'.$value['yj_yjmc'];
+        }
+
+        $this->success('成功',$rows);
+    }
 }