Browse Source

产品印件开数联数获取

qiuenguang 1 year ago
parent
commit
93ba00f228
1 changed files with 24 additions and 0 deletions
  1. 24 0
      application/api/controller/Product.php

+ 24 - 0
application/api/controller/Product.php

@@ -1098,4 +1098,28 @@ class Product extends Api
             $this->error('修改失败');
         }
     }
+
+    /**
+     * 获取联数
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function getCouplet()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (empty($param['product']) || empty($param['yjno'])){
+            $this->error('参数错误');
+        }
+        $list = \db('产品_印件资料')
+            ->where('yj_cpdh',$param['product'])
+            ->where('yj_yjno',$param['yjno'])
+            ->field('rtrim(yj_ks) as 开数,rtrim(yj_ls) as 联数')
+            ->find();
+        $this->success('成功',$list);
+    }
 }