Browse Source

Merge branch 'version1.5' of ssh://192.168.10.210:10022/wugg/stock into version1.5

panlumeng 3 years ago
parent
commit
a0b901a45c

+ 64 - 0
app/admin/controller/Consult.php

@@ -114,6 +114,10 @@ class Consult extends Base
         $data=[];
         foreach ($list as $value){
             $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
+            $value['specinfo']=isset($value['specinfo'])&&$value['specinfo']!=""? json_decode($value['specinfo'],
+                true):[];
+            $brand = Db::name("brand")->where(['id'=>$value['brand_id']])->find();
+            $value['brand_name']= isset($brand['brand_name']) && $brand['brand_name']!='' ? $brand['brand_name']:"";
             $value['khname']="";
             if($value['khNo']!==""){
                 $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
@@ -1661,4 +1665,64 @@ class Consult extends Base
 
         return app_show(0,"获取成功",["list"=>$data,"count"=>$count]);
     }
+
+    public function  crontablist(){
+        $page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) :"1";
+        $size = isset($this->post['size']) && $this->post['size'] !== "" ? intval($this->post['size']) :"10";
+        $where=[['a.is_del',"=",0],['b.is_del',"=",0]];
+        $zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
+        if ($zxNo !== "") {
+            $where[] = ['a.zxNo','=',$zxNo];
+        }
+        $salesman = isset($this->post['salesman']) && $this->post['salesman'] !== "" ? trim($this->post['salesman']) : "";
+        if ($salesman !== "") {
+            //$where["salesman"] =Db::Raw("like '%$salesman%'");
+            $where[]= ["b.salesman",'like',"%$salesman%"];
+        }
+        $cpName = isset($this->post['cpName']) && $this->post['cpName'] !== "" ? trim($this->post['cpName']) : "";
+        if ($cpName !== "") {
+            //$where["cpName"]= Db::Raw("like '%$cpName%'");
+            $where[]= ["a.good_Name",'like',"%$cpName%"];
+        }
+        $khNo = isset($this->post['khNo']) && $this->post['khNo'] !== "" ? trim($this->post['khNo']) : "";
+        if ($khNo !== "") {
+            // $where['khNo'] = $khNo;
+            $where[]= ["b.khNo",'like',"%$khNo%"];
+        }
+        $start= isset($this->post['start']) && $this->post['start'] !== "" ? $this->post['start']:"";
+        if ($start !="") {
+            //$where = ["zxtime"=>Db::raw(">= '{$start}'")];
+            $where[]= ["a.addtime",'>=',$start];
+        }
+        $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] :"";
+        if($end !=""){
+            $where[]= ["a.addtime",'<=',$end];
+        }
+        $status = isset($this->post['status']) && $this->post['status'] !== "" ? trim($this->post['status']) : "";
+        if ($status !== "") {
+            $where[]= ["a.status",'=',$status];
+        }
+        $count = Db::name('consult_info')->alias("a")->leftJoin("consult_order b","a.zxNo=b.zxNo")->where($where)
+            ->count();
+        $total = ceil($count / $size);
+        $page = $page >= $total ? $total : $page;
+        $list =Db::name('consult_info')->alias("a")->leftJoin("consult_order b","a.zxNo=b.zxNo")->where($where)->page($page,$size)
+            ->field("a.*,b.createrid,b.creater,b.is_project,b.projectNo,b.khNo,b.endtime,b.platform_code,b.saleid,b.salesman,b.depart")->select();
+        $data=[];
+        foreach ($list as $value){
+            $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
+            $brand = Db::name("brand")->where(['id'=>$value['brand_id']])->find();
+            $value['brand_name']= isset($brand['brand_name']) && $brand['brand_name']!='' ? $brand['brand_name']:"";
+            $value['khname']="";
+            $value['specinfo']=isset($value['specinfo'])&&$value['specinfo']!=""? json_decode($value['specinfo'],
+                true):[];
+            if($value['khNo']!==""){
+                $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
+                $value['khname']= isset($kh['companyName'])?$kh['companyName']:"";
+            }
+            $value['metal_name']=isset($value['metal_id'])&& $value['metal_id']!=0?$this->noble[$value['metal_id']]:"";
+            $data[]=$value;
+        }
+        return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
+    }
 }

+ 2 - 0
app/admin/controller/Good.php

@@ -204,6 +204,8 @@ class Good extends \app\BaseController
             list($place['provice_code'],$place['city_code'],$place['area_code'])=explode(",",$data['origin_place']);
             $data['origin_place_cn']=GetAddr(json_encode($place));
         }
+        $excluse = makeExcluse($data['is_exclusive']);
+        $data['exclusive']=$excluse;
         $data["good_info_img"]=$data['good_info_img']!=""? json_decode($data['good_info_img'],true):[];
         $speclist=[];
         if(!empty($spec)){

+ 12 - 1
app/admin/controller/Goodup.php

@@ -20,7 +20,8 @@ class Goodup extends BaseController
         $where =[["is_del","=",0]];
         $cat_id = isset($this->post['cat_id']) && $this->post['cat_id'] !=="" ? intval($this->post['cat_id']):"";
         if($cat_id!==""){
-            $where[]=['cat_id',"=",$cat_id];
+            $cat_ids=catChild($cat_id);
+            $where[]=['cat_id',"in",$cat_ids];
         }
         $good_name = isset($this->post['good_name']) && $this->post['good_name'] !=="" ? trim($this->post['good_name']):"";
         if($good_name!==""){
@@ -166,6 +167,7 @@ class Goodup extends BaseController
 //        if($auth_img==''){
 //            return error_show(1004,"商品不能为空");
 //        }
+
         $after_sales = isset($this->post['after_sales'])&&$this->post['after_sales']!=""? trim($this->post['after_sales']):"";
         if($after_sales==""){
             return error_show(1004,"参数after_sales不能为空");
@@ -231,7 +233,11 @@ class Goodup extends BaseController
         if($is_stock===""){
             return error_show(1004,"参数is_stock不能为空");
         }
+        $is_diff = isset($this->post['is_diff'])&&$this->post['is_diff']!==""? intval($this->post['is_diff']):"0";
+
         $good_img = isset($this->post['good_img'])&&$this->post['good_img']!==""? trim($this->post['good_img']):"";
+        $config = isset($this->post['config'])&&$this->post['config']!==""? trim($this->post['config']):"";
+        $other_config = isset($this->post['other_config'])&&$this->post['other_config']!==""? trim($this->post['other_config']):"";
 //        if($good_img===""){
 //            return error_show(1004,"参数good_img不能为空");
 //        }
@@ -332,6 +338,9 @@ class Goodup extends BaseController
                 "is_gold_price"=>$is_gold_price,
                 "market_price"=>$market_price,
                 "nake_price"=>$nake_price,
+                "is_diff"=>$is_diff,
+                "config"=>$config,
+                "other_config"=>$other_config,
                 "is_step"=>$is_step,
                 "is_online"=>0,
                 "status"=>0,
@@ -800,6 +809,8 @@ class Goodup extends BaseController
             $data["brand_name"]="";
             $data["brand_id"]="";
         }
+        $excluse = makeExcluse($data['is_exclusive']);
+        $data['exclusive']=$excluse;
         $data["good_info_img"]=$data['good_info_img']!=""? json_decode($data['good_info_img'],true):[];
         $speclist=[];
         if(!empty($spec)){

+ 4 - 1
app/admin/controller/Resign.php

@@ -138,7 +138,10 @@ class Resign extends BaseController
         if($good==false){
             return error_show(1004,"未找到商品数据");
         }
-        $lastime = isset($this->post['lastime'])&&$this->post['lastime']!="" ? $this->post['lastime']:date("Y-m-d H:i:s");
+        $lastime = isset($this->post['lastime'])&&$this->post['lastime']!="" ? $this->post['lastime']:"";
+        if($lastime===""){
+            return error_show(1004,"参数lastime不能为空");
+        }
         $data = GetUserInfo($token);
         if((!empty($data) && $data['code']!=0) ||empty($data) ){
             return error_show($data['code'],$data['message']);

+ 304 - 8
app/admin/controller/Sale.php

@@ -132,12 +132,7 @@ class Sale extends BaseController
 
         }
         $remark =isset($this->post['remark']) && $this->post['remark'] !=="" ?trim($this->post['remark']):"";
-        if($sendtype==1){
-            $addrlist = isset($this->post['addrlist']) && $this->post['addrlist'] !=="" ?$this->post['addrlist']:"";
-            if($addrlist=="" || empty($addrlist) ||!is_array($addrlist)){
-                return error_show(1004,"参数addrlist不能为空");
-            }
-        }
+
         $proofid= isset($this->post['proof_id'])&&$this->post['proof_id']===""?intval($this->post['proof_id']):"0";
 
         $apply_id =GetUserInfo($token);
@@ -443,7 +438,6 @@ class Sale extends BaseController
                             break;
                         }
                     }
-
                 }else{
                     Db::rollback();
                     return error_show(1002,"发货地址添加创建失败");
@@ -458,6 +452,308 @@ class Sale extends BaseController
 
     }
 
+    public  function consultOrder(){
+        $bidNo =isset($this->post['bidNo'])&&$this->post['bidNo']!="" ?  trim($this->post['bidNo']):"";
+        if($bidNo==""){
+            return error_show(1003,"参数bidNo不能为空");
+        }
+        $zxinfo = Db::name("consult_bid")->where(["bidNo"=>$bidNo,"is_del"=>0])->find();
+        if($zxinfo==false){
+            return error_show(1003,"未找到咨询单商品信息");
+        }
+        if($zxinfo['status']!=5){
+            return error_show(1003,"咨询单状态有误无法转单");
+        }
+        $zx =Db::name("consult_info")->where(["infoNo"=>$zxinfo['infoNo'],"is_del"=>0])->find();
+        if($zx==false){
+            return error_show(1003,"未找到咨询单信息");
+        }
+        if($zx['status']!=2){
+            return error_show(1003,"咨询单任务未结束");
+        }
+        $zxorder =Db::name("consult_order")->where(["zxNo"=>$zx["zxNo"],"is_del"=>0])->find();
+        if($zxorder==false){
+            return error_show(1003,"未找到咨询单信息");
+        }
+        $good_num =isset($this->post['good_num'])&&$this->post['good_num']!="" ?  intval($this->post['good_num']):"";
+        if($good_num===""){
+            return error_show(1003,"参数good_num不能为空");
+        }
+        $sendtype = isset($this->post['sendtype'])&&$this->post['sendtype']!="" ? intval($this->post['sendtype']):"";
+        if($sendtype==""){
+            return error_show(1003,"参数sendtype不能为空");
+        }
+        $orderCode = makeNo("QR");
+        $spuCode = $zxinfo['spuCode'];
+        $skuCode = "";
+        $is_stock=0;
+        $cgd=[
+            "supplierNo"=>$zxinfo['supplierNo'],
+            "companyNo"=>$zxorder['companyNo'],
+            "spuCode"=>$spuCode,
+            "skuCode"=>$skuCode,
+            "orderCode"=>$orderCode,
+            "good_name"=>$zxinfo['good_name'],
+            "sale_price"=>$zxinfo['sale_price'],
+            "total_fee"=>$zxinfo['total_fee'],
+            "pakge_fee"=>$zxinfo['pakge_fee'],
+            "cert_fee"=>$zxinfo['cert_fee'],
+            "open_fee"=>$zxinfo['open_fee'],
+            "cost_fee"=>$zxinfo['cost_fee'],
+            "mark_fee"=>$zxinfo['mark_fee'],
+            "demo_fee"=>$zxinfo['demo_fee'],
+            "good_num"=>$good_num,
+            "good_type"=>1,
+            "is_diff"=>$zxinfo['is_diff'],
+            "order_type"=>3,
+        ];
+        $token=isset($this->post['token'])&&$this->post['token']!=""? trim($this->post['token']):"";
+        if($token==""){
+            return error_show(102, "参数token不能为空");
+        }
+        $apply_id = GetUserInfo($token);
+        if (empty($apply_id) || $apply_id['code'] != 0) {
+            return error_show(102, "申请人数据不存在");
+        }
+        $rm = isset($apply_id["data"]['id']) ? $apply_id["data"]['id'] : "";
+        $ri = isset($apply_id["data"]['nickname']) ? $apply_id["data"]['nickname'] : "";
+
+        $va = isset($this->post['order_addr']) && $this->post['order_addr'] !== "" ? $this->post['order_addr'] : "";
+        if($sendtype==1){
+            if ($va == "") {
+                return error_show(1002, "参数order_addr不能为空");
+            }
+        }
+        $arrtime=isset($this->post['arrtime'])&&$this->post['arrtime']!="" ?$this->post['arrtime']:"";
+        if($arrtime==""){
+            return error_show(1002, "参数arrtime不能为空");
+        }
+        Db::startTrans();
+        try{
+            $data=[
+                "orderCode"=>$orderCode,
+                "good_code"=>$spuCode,
+                "skuCode"=>$skuCode,
+                "customer_code"=>$zx['khNo'],
+                "good_name"=>isset($zxinfo['good_name'])&&$zxinfo['good_name']!==''?$zxinfo['good_name']:'',
+                "good_num"=>$good_num,
+                "cat_id"=>$zxinfo['cat_id'],
+                "apply_id"=>$rm,
+                "apply_name"=>$ri,
+                "origin_price"=>$zxinfo['nake_fee'],
+                "sale_price"=>$zxinfo['sale_price'],
+                "post_fee"=>0,
+                "status"=>0,
+                "send_num"=>0,
+                "wsend_num"=>$good_num,
+                "send_status"=>1,
+                "good_type"=>1,
+                "send_type"=>$sendtype,
+                "supplierNo"=>$zx['companyNo'],
+                "is_del"=>0,
+                "zxNo"=>$bidNo,
+                "platform_order"=>"",
+                "platform_id"=>0,
+                "remark"=>"",
+                "is_stock"=>0,
+                "is_activity"=>0,
+                "proof_id"=>0,
+                "order_type"=>3,
+                "addtime"=>date("Y-m-d H:i:s"),
+                "updatetime"=>date("Y-m-d H:i:s"),
+                'total_price'=>round($zxinfo['sale_price']*$good_num,2),
+            ];
+            $datainfo = Db::name('sale')->insert($data, true);
+            if($datainfo>0){
+                    $zxinfo['status']=6;
+                    $zxinfo['updatetime']=date("Y-m-d H:i:s");
+                    $sa=Db::name("consult_bids")->save($zxinfo);
+                    if($sa==false){
+                        Db::rollback();
+                        return error_show(1002,"咨询单修改失败");
+                    }
+                    $bol=$this->createCgd($cgd);
+                    if($bol==false){
+                        Db::rollback();
+                        return error_show(1002,"咨询订单创建失败");
+                    }
+                    $limt=[
+                        "spuCode"=>$zxinfo['spuCode'],
+                        "good_name"=>$zxinfo['good_name'],
+                        "brand_id"=>$zxinfo['brand_id'],
+                        "good_unit"=>$zxinfo['good_name'],
+                        "cat_id"=>$zxinfo['cat_id'],
+                        "good_type"=>0,
+                        "moq"=>1,
+                        "customized"=>$zxinfo['work_day'],
+                        "tax"=>$zxinfo['tax'],
+                        "supplierNo"=>$zxinfo["supplierNo"],
+                        "is_auth"=>0,
+                        "craft_desc"=>$zxinfo['good_name'],
+                        "good_remark"=>"",
+                        "good_img"=>$zxinfo['good_img'],
+                        "good_thumb_img"=>"",
+                        "good_info_img"=>"",
+                        "status"=>1,
+                        "is_del"=>0,
+                        "createrid"=>$rm,
+                        "creater"=>$ri,
+                        "addtime"=>date("Y-m-d H:i:s"),
+                        "updatetime"=>date("Y-m-d H:i:s")
+                    ];
+                    $good = Db::name("good_zixun")->insert($limt);
+                    if(!$good){
+                        Db::rollback();
+                        return error_show(1006,"咨询商品录入失败");
+                    }
+                    if(!empty($order_addr)){
+                        $order =Db::name("order_num")->where(["orderCode"=>$orderCode,"status"=>1])->where([["wsend_num",">=",0]])
+                            ->find();
+                        if($order==false){
+                            Db::rollback();
+                            return error_show(1006,"采购单关联数据未找到");
+                        }
+                        foreach ($order_addr as $value){
+                            $temp=[];
+                            $addrs=[];
+                            if($value['addr_code']!==''&&is_array($value['addr_code'])){
+                                $addrs['provice_code'] = $value['addr_code'][0];
+                                $addrs['city_code'] = $value['addr_code'][1];
+                                $addrs['area_code'] = $value['addr_code'][2];
+                                $addr = json_encode($addrs);
+                            }else{
+                                $addr = isset($value['addr_code'])?$value['addr_code']:'';
+                            }
+                            $temp['orderCode']=$orderCode;
+                            $temp['contactor']=$value['contactor'];
+                            $temp['mobile'] = $value['mobile'];
+                            $temp['addr'] = $value['addr'];
+                            $temp['addr_code']=$addr;
+                            $temp['customer_code'] =$zx['khNo'];
+                            $temp['receipt_quantity']=$value['receipt_quantity'];
+                            $temp['post_fee'] =0;
+                            $temp['is_del'] =0;
+                            $temp['addtime'] =date("Y-m-d H:i:s");
+                            $temp['updatetime'] =date("Y-m-d H:i:s");
+                            $temp['arrive_time']=$arrtime;
+                            $vmp = Db::name('order_addr')->insert($temp,true);
+                            if($vmp>0){
+                                $outCode=makeNo("CK");
+                                $out=[
+                                    "orderCode"=>$orderCode,
+                                    "outCode"=>$outCode,
+                                    "apply_id"=>$rm,
+                                    "apply_name"=>$ri,
+                                    "addrid"=>$vmp,
+                                    "post_name"=>"",
+                                    "post_code"=>"",
+                                    "post_fee"=>0,
+                                    "sendtime"=>date("Y-m-d H:i:s"),
+                                    "send_num"=>$value['receipt_quantity'],
+                                    "check_num"=>0,
+                                    "error_num"=>0,
+                                    "wsm_code"=>"",
+                                    "order_type"=>3,
+                                    "status"=>0,
+                                    "addtime"=>date("Y-m-d H:i:s"),
+                                    "updatetime"=>date("Y-m-d H:i:s")
+                                ];
+                                $ou =Db::name("order_out")->insert($out);
+                                if($ou==false){
+                                    Db::rollback();
+                                    return error_show(1002,"发货地址添加创建失败");
+                                }
+                                $order['send_num']+=$value['receipt_quantity'];
+                                $order['wsend_num']-=$value['receipt_quantity'];
+                                if($order['wsend_num']<0){
+                                    Db::rollback();
+                                    return error_show(1002,"发货数量已超出总数");
+                                }
+                                $ups = Db::name("order_num")->save($order);
+                                if($ups){
+                                    $tep=[
+                                        "cgdNo"=>$order['cgdNo'],
+                                        "outCode"=>$outCode,
+                                        "send_num"=>$value['receipt_quantity'],
+                                        "status"=>1,
+                                        "addtime"=>date("Y-m-d H:i:s"),
+                                        "updatetime"=>date("Y-m-d H:i:s")
+                                    ];
+                                    $sen=Db::name("order_send")->save($tep);
+                                    if($sen==false){
+                                        Db::rollback();
+                                        return error_show(1002,"发货地址添加创建失败");
+                                    }
+                                }
+
+                            }else{
+                                Db::rollback();
+                                return error_show(1002,"发货地址添加创建失败");
+                            }
+                        }
+                    }
+                Db::commit();
+                return error_show(0,"咨询订单创建成功",["order_code"=>$orderCode]);
+            }
+            Db::rollback();
+            return error_show(1002,"咨询订单创建失败");
+        }catch(\Exception $e){
+            Db::rollback();
+            return error_show(1003,$e->getMessage());
+        }
+    }
+
+    /**
+     * @return \think\response\Json|void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+
+    public function projectCreate(){
+        $planNo =isset($this->post['planNo'])&&$this->post['planNo']!=""?trim($this->post['planNo']):"";
+        if($planNo==""){
+            return error_show(1004,"参数planNo不能为空");
+        }
+       $plan =Db::name("project_plan")->where(["planNo"=>$planNo,"is_del"=>0])->find();
+       if($plan==false){
+           return error_show(1004,"未找到方案信息");
+       }
+        $feedbackid = Db::name("project_plan_rela")->where(["planNo"=>$planNo,"is_del"=>0])->column("feedback_id");
+       if($feedbackid==false){
+           return error_show(1004,"未找到方案反馈信息");
+       }
+        $arrtime=isset($this->post['arrtime'])&&$this->post['arrtime']!="" ?$this->post['arrtime']:"";
+        if($arrtime==""){
+            return error_show(1002, "参数arrtime不能为空");
+        }
+        $planinfo =isset($this->post['planinfo'])&&!empty($this->post['planinfo']) ?$this->post['planinfo']:"";
+        if($planinfo==""){
+            return error_show(1002, "参数planinfo不能为空");
+        }
+
+        foreach ($planinfo as $value){
+            $feedback = Db::name("project_plan")->where(["pgNo"=>$value['pgNo'],"projectNo"=>$plan['project'],"is_del"=>0])->find();
+            if($feedback==false){
+                return error_show(1002, "反馈数据未找到");
+            }
+            if($feedback['data_source']==1){
+                $feed=$this->project_good($feedback);
+                if($feed==false){
+                    return error_show(1002, "咨询订单生成失败");
+                }
+            }
+        }
+    }
+
+
+    public function project_zx($data){}
+    public function project_good($data){}
+
+
+
+
+
     public function list()
     {
         $page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) : "1";
@@ -1140,7 +1436,7 @@ class Sale extends BaseController
         Db::startTrans();
         try {
             $data = [
-                "wsm_code" => $wsm_code,
+                "wsm_code" => "",
                 "orderCode" => $orderCode,
                 "outCode" => $outCode,
                 "order_type" => $der['order_type'],

+ 3 - 0
app/admin/route/app.php

@@ -105,6 +105,7 @@ Route::rule('saleout','admin/Sale/out');
 Route::rule('salecustomer','admin/Sale/customer');
 Route::rule('xsaleout','admin/Sale/saleout');
 Route::rule('saleoutinfo','admin/Sale/outinfo');
+Route::rule('saleaddr','admin/Sale/addAddr');
 
 Route::rule('checkflist','admin/Check/flist');
 Route::rule('checklist','admin/Check/list');
@@ -418,6 +419,8 @@ Route::rule('bragaininfo','admin/Consult/bargain_info');
 Route::rule('zxedit','admin/Consult/zxedit');
 Route::rule('bargainlist','admin/Consult/bragain_list');
 
+Route::rule('crontablist','admin/Consult/crontablist');
+
 
 Route::rule('supplercreate','admin/Suppler/create');
 Route::rule('supplerlist','admin/Suppler/list');

+ 33 - 0
app/common.php

@@ -426,6 +426,39 @@ function made($var,$data=[]){
         return made($str['pid'],$data);
     }
 }
+function catChild($var,&$data=[]){
+    $str = Db::name('cat')->where(['id'=>$var])->find();
+    if($str==false){
+        return;
+    }
+    $data[]=$var;
+   $lsit = Db::name("cat")->where(["pid"=>$var,"status"=>1,"is_del"=>0])->column("id");
+   if(!empty($lsit)){
+       foreach ($lsit as $value){
+           catChild($value,$data);
+       }
+   }
+   return $data;
+}
+
+
+function makeExcluse($var,$data=[]){
+    $str = Db::name('exclusive')->where(['id'=>$var])->find();
+    if($str==false){
+        return [];
+    }
+    $vmn =[];
+    $vmn['id'] =$str['id'];
+    $vmn['name'] =$str['name'];
+    array_unshift($data,$vmn);
+    // $var['id']=made();
+    if($str['pid']==0){
+        // krsort($data);
+        return $data;
+    }else{
+        return makeExcluse($str['pid'],$data);
+    }
+}
 
 function sear($id){
     $item = Db::name('cat')->where(['id'=>$id])->field("search")->find();