Browse Source

获取产品附件列表

曹鹤洋 1 year ago
parent
commit
90ba9a909f
1 changed files with 20 additions and 0 deletions
  1. 20 0
      application/api/controller/WorkOrder.php

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

@@ -1686,6 +1686,26 @@ class WorkOrder extends Api
         $this->success('成功',$list);
     }
 
+    public function getAnnexTable(){
+        if(!$this->request->isGet()){
+            $this->error('请求方式错误');
+        }
+        $req = $this->request->param();
+        if (isset($req['cpdh']) && !empty($req['cpdh'])){
+            $where['关联产品'] = ['LIKE','%'.$req['cpdh'].'%'];
+        }else{
+            $this->error('参数错误');
+        }
+        $rows = db('产品_技术附件')
+            ->where($where)
+            ->select();
+        foreach ($rows as &$row) {
+            $row['附件内容'] = base64_encode($row['附件内容']);
+        }
+        $this->success('成功',$rows)->header(['Content-Type' => 'application/octet-stream']);
+    }
+
+    
     //02-产品管理-技术资料附件
     public function getExcelInfo()
     {