liuhairui 3 weken geleden
bovenliggende
commit
866661b71b
2 gewijzigde bestanden met toevoegingen van 19 en 20 verwijderingen
  1. 1 7
      application/api/controller/ProcessLib.php
  2. 18 13
      application/api/controller/Product.php

+ 1 - 7
application/api/controller/ProcessLib.php

@@ -21,12 +21,6 @@ class ProcessLib extends Api
         $this->success('产品_工艺资料库');
     }
 
-    /**
-     * 新增产品工艺库
-     */
-    /**
-     * 新增产品工艺库
-     */
     /**
      * 新增产品工艺库
      */
@@ -81,7 +75,7 @@ class ProcessLib extends Api
         $where = [];
 
         if (!empty($params['search'])){
-            $where['工序编码|工序名称|生产工序'] = array('like','%'.$params['search'].'%');
+            $where['gy_code|gy_name|big_process'] = array('like','%'.$params['search'].'%');
         }
 
         $limit = $params['limit'];

+ 18 - 13
application/api/controller/Product.php

@@ -24,6 +24,9 @@ class Product extends Api
         $this->success('产品_基本资料');
     }
 
+    /**
+     * 产品资料
+     */
     /**
      * 新增产品资料
      */
@@ -180,9 +183,9 @@ class Product extends Api
     }
 
     /**
-     * 获取产品工艺列表
+     * 获取产品部件列表
      */
-    public function ProductGyList()
+    public function ProductPartList()
     {
         if (Request::instance()->isGet() == false){
             $this->error('非法请求');
@@ -192,10 +195,10 @@ class Product extends Api
         $where = [];
 
         if (!empty($params['search'])){
-            $where['gy_name'] = array('like','%'.$params['search'].'%');
+            $where['part_name'] = array('like','%'.$params['search'].'%');
         }
         if (!empty($params['product_code'])){
-            $where['product_code'] = $params['product_code'];
+            $where['product_code'] = array('like','%'.$params['product_code'].'%');
         }
         $limit = $params['limit'];
         if (empty($limit)){
@@ -205,17 +208,16 @@ class Product extends Api
         if (empty($pages)){
             $pages = 1;
         }
-        $list = \db('产品_工艺资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->order('id desc')->select();
-        $count = \db('产品_工艺资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->count();
+        $list = \db('产品_部件资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->order('id desc')->select();
+        $count = \db('产品_部件资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->count();
 
         $this->success('获取成功', ['list' => $list, 'count' => $count]);
-
     }
 
     /**
-     * 获取产品部件列表
+     * 获取产品工艺列表
      */
-    public function ProductPartList()
+    public function ProductGyList()
     {
         if (Request::instance()->isGet() == false){
             $this->error('非法请求');
@@ -225,10 +227,10 @@ class Product extends Api
         $where = [];
 
         if (!empty($params['search'])){
-            $where['part_name'] = array('like','%'.$params['search'].'%');
+            $where['gy_name'] = array('like','%'.$params['search'].'%');
         }
         if (!empty($params['product_code'])){
-            $where['product_code'] = array('like','%'.$params['product_code'].'%');
+            $where['product_code'] = $params['product_code'];
         }
         $limit = $params['limit'];
         if (empty($limit)){
@@ -238,11 +240,14 @@ class Product extends Api
         if (empty($pages)){
             $pages = 1;
         }
-        $list = \db('产品_部件资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->order('id desc')->select();
-        $count = \db('产品_部件资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->count();
+        $list = \db('产品_工艺资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->order('id desc')->select();
+        $count = \db('产品_工艺资料')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->count();
 
         $this->success('获取成功', ['list' => $list, 'count' => $count]);
+
     }
 
 
+
+
 }