wugg 8 月之前
父節點
當前提交
daed819d0b
共有 2 個文件被更改,包括 53 次插入1 次删除
  1. 1 1
      app/admin/model/AdminMenu.php
  2. 52 0
      app/user/controller/TaxCategory.php

+ 1 - 1
app/admin/model/AdminMenu.php

@@ -86,7 +86,7 @@ class AdminMenu extends Base
    }
    }
 
 
    public function GetMenuActionTree($pid=0,$level=[]){
    public function GetMenuActionTree($pid=0,$level=[]){
-        $where=['pid'=>$pid,'is_del'=>0,'status'=>1];
+        $where=['pid'=>$pid,'is_del'=>0];
         if(!empty($level) && $pid>0) $where['level']=$level;
         if(!empty($level) && $pid>0) $where['level']=$level;
         $result = $this->field('menu_name,menu_img,menu_route,menu_url,is_display,status,pid,weight,id,level')
         $result = $this->field('menu_name,menu_img,menu_route,menu_url,is_display,status,pid,weight,id,level')
         ->where($where)
         ->where($where)

+ 52 - 0
app/user/controller/TaxCategory.php

@@ -0,0 +1,52 @@
+<?php
+
+
+namespace app\user\controller;
+
+
+use think\App;
+class TaxCategory extends Base{
+    public function __construct(App $app) {
+        parent::__construct($app);
+        $this->model = new \app\user\model\TaxCategory();
+    }
+    public function list(){
+        $params=$this->request->param(["cat_name"=>"","cat_code"=>"","status"=>[],"page"=>1,"size"=>15],"post","trim");
+        $where=[];
+        if($params["cat_name"]!='') $where[]=["cat_name|short_name","like","%".$params["cat_name"]."%"];
+        if($params["cat_code"]!='') $where[]=["cat_code|merge_code","like","%".$params["cat_code"]."%"];
+        if(!empty($params["status"])) $where[]=["status","in",$params["status"]];
+        $list=$this->model->where($where)->order("status asc,id desc")->paginate(["page"=>$params["page"],"list_rows"=>$params["size"]]);
+        return success("获取成功",["list"=>$list->items(),"count"=>$list->total()]);
+    }
+
+    public function query(){
+        $params=$this->request->param(["cat_name"=>"","cat_code"=>"","status"=>[]],"post","trim");
+        $where=[["tax","<>",""]];
+        if($params["cat_name"]!='') $where[]=["cat_name|short_name","like","%".$params["cat_name"]."%"];
+        if($params["cat_code"]!='') $where[]=["cat_code|merge_code","like","%".$params["cat_code"]."%"];
+        if(!empty($params["status"])) $where[]=["status","in",$params["status"]];
+        $list=$this->model->where($where)
+        ->field('cat_name,cat_code,status,tax,addtax,sumitem,`desc`,short_name,merge_code,LENGTH(cat_name) as weight')
+        ->order("weight asc,id desc")
+         ->limit(30)->select()->toArray();
+        return success("获取成功",$list);
+    }
+
+    public function listByCompany(){
+        $params=$this->request->param([
+            "cat_name"=>"",
+            "short_name"=>"",
+            "relation_status"=>"",
+            "cat_code"=>"",
+            "use_status"=>"",
+            "companyNo"=>"",
+            "page"=>1,"size"=>15],"post","trim");
+        $where=[];
+        if($params["cat_name"]!='') $where[]=["cat_name","like","%".$params["cat_name"]."%"];
+        if($params["short_name"]!='') $where[]=["short_name","like","%".$params["short_name"]."%"];
+        if($params["relation_status"]!='') {
+
+        }
+    }
+}