Browse Source

Mergt e branch 'master' of https://git.7in6.com/Minong/mes-server-api

曹鹤洋 1 year ago
parent
commit
7d2d5f1b51
1 changed files with 37 additions and 0 deletions
  1. 37 0
      application/api/controller/WorkOrder.php

+ 37 - 0
application/api/controller/WorkOrder.php

@@ -1920,4 +1920,41 @@ class WorkOrder extends Api
 
 
     }
     }
 
 
+    /**
+     * 引用工单资料数据查询
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function WorkOrderDetailCope()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (empty($param['search'])){
+            $this->error('参数错误');
+        }
+        $list = \db('工单_基本资料')
+            ->alias('a')
+            ->field([
+                'rtrim(a.Gd_gdbh)' => '工单编号',
+                'rtrim(b.客户编号)' => '客户编号',
+                'rtrim(b.客户名称)' => '客户名称',
+                'rtrim(b.产品编号)' => '产品编号',
+                'rtrim(b.产品名称)' => '产品名称'
+            ])
+            ->join('产品_基本资料 b','a.成品代号 = b.产品编号')
+            ->where('a.Gd_gdbh','like','%'.$param['search'].'%')
+            ->whereOr('a.成品名称','like','%'.$param['search'].'%')
+            ->group('a.Gd_gdbh')
+            ->select();
+        if (empty($list)){
+            $this->success('未找到工单资料');
+        }else{
+            $this->success('成功',$list);
+        }
+    }
+
 }
 }