|
|
@@ -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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|