Browse Source

专属类型列表复用

wufeng 2 years ago
parent
commit
be7be209f6
2 changed files with 21 additions and 0 deletions
  1. 20 0
      app/abutment/controller/Index.php
  2. 1 0
      app/abutment/route/app.php

+ 20 - 0
app/abutment/controller/Index.php

@@ -6,6 +6,7 @@ use app\abutment\logic\Index as IndexLogic;
 use app\BaseController;
 use think\exception\ValidateException;
 use think\facade\Config;
+use think\facade\Db;
 use think\facade\Validate;
 
 
@@ -113,6 +114,25 @@ class Index extends BaseController
     }
 
 
+    //专属类型列表
+    public function getExclusiveList(){
+
+        $pid =  $this->request->filter('trim')->post('pid/d',0);
+        $where=[["is_del","=",0],["pid","=",$pid]];
+        
+        $cat_name=$this->request->filter('trim')->post('cat_name','');
+        if($cat_name!=="") $where[]=['cat_name',"like","%$cat_name%"];
+
+        $data = Db::name("exclusive")
+            ->where($where)
+            ->select()
+            ->toArray();
+        $vmp = [];
+        foreach ($data as $sts){
+            $vmp[]=coco($sts);
+        }
+        return json_show(0,"获取成功",$vmp);
+    }
 
 
 }

+ 1 - 0
app/abutment/route/app.php

@@ -16,6 +16,7 @@ route::rule('getSpecsTitleList', 'abutment/Index/getSpecsTitleList');//获取规
 route::rule('getSpecsValueByTitleList', 'abutment/Index/getSpecsValueByTitleList');//获取规格值列表
 route::rule('getAreaList', 'abutment/Index/getAreaList');//获取省市区列表
 route::rule('getCompanyNoList', 'abutment/Index/getCompanyNoList');//获取业务公司编码
+route::rule('getExclusiveList', 'abutment/Index/getExclusiveList');//专属类型列表
 
 
 //商品模块