Browse Source

添加工单->产品代号获取

qiuenguang 1 year ago
parent
commit
3a789e0ca2
1 changed files with 10 additions and 2 deletions
  1. 10 2
      application/api/controller/WorkOrder.php

+ 10 - 2
application/api/controller/WorkOrder.php

@@ -1482,11 +1482,19 @@ class WorkOrder extends Api
             $this->error('请求错误');
         }
         $param = $this->request->param();
-        if (empty($param)){
+        if (isset($param['cilent']) === false){
             $this->error('参数错误');
         }
+        if (isset($param['productCode'])){
+            $where = [
+                '客户编号' => ['like',$param['cilent'].'%'],
+                '产品编号' => ['like',$param['productCode'].'%']
+            ];
+        }else{
+            $where = ['客户编号'=>['like',$param['cilent'].'%']];
+        }
         $list = \db('产品_基本资料')
-            ->where('客户编号',$param['cilent'])
+            ->where($where)
             ->field('rtrim(产品编号) as 产品编号,rtrim(产品名称) as 产品名称')
             ->select();
         if (empty($list)){