|
@@ -102,35 +102,41 @@ class Exclusive extends Base
|
|
|
}
|
|
|
|
|
|
public function query(){
|
|
|
- $where =[["is_del","=",0]];
|
|
|
- $cat_name=isset($this->post['name']) && $this->post['name'] !==""? trim($this->post['name']) :"";
|
|
|
+// $where =[["is_del","=",0]];
|
|
|
+// $cat_name=isset($this->post['name']) && $this->post['name'] !==""? trim($this->post['name']) :"";
|
|
|
+// if($cat_name!==""){
|
|
|
+// $where[]=['name',"like","%$cat_name%"];
|
|
|
+// }
|
|
|
+// $pid=isset($this->post['pid']) && $this->post['pid'] !==""? intval($this->post['pid']) :"";
|
|
|
+// if($pid!==""){
|
|
|
+// $where[]=['pid',"=",$pid];
|
|
|
+// }
|
|
|
+// $status=isset($this->post['status']) && $this->post['status'] !==""? intval($this->post['status']) :"";
|
|
|
+// if($status!==""){
|
|
|
+// $where[]=['status',"=",$status];
|
|
|
+// }
|
|
|
+// $level=isset($this->post['level']) && $this->post['level'] !==""? intval($this->post['level']) :"";
|
|
|
+// if($level!==""){
|
|
|
+// $where[]=['level',"=",$level];
|
|
|
+// }
|
|
|
+// $list = Db::name("exclusive")->where($where)->select();
|
|
|
+// return app_show(0,"获取成功",$list);
|
|
|
+
|
|
|
+ $where=[["is_del","=",0]];
|
|
|
+ $pid = isset($this->post['pid']) &&$this->post['pid']!=="" ?intval($this->post['pid']): "0";
|
|
|
+ $where[]=["pid","=",$pid];
|
|
|
+ $cat_name=isset($this->post['cat_name']) && $this->post['cat_name'] !==""? intval($this->post['cat_name']) :"";
|
|
|
if($cat_name!==""){
|
|
|
- $where[]=['name',"like","%$cat_name%"];
|
|
|
+ $where[]=['cat_name',"like","%$cat_name%"];
|
|
|
}
|
|
|
- $pid=isset($this->post['pid']) && $this->post['pid'] !==""? intval($this->post['pid']) :"";
|
|
|
- if($pid!==""){
|
|
|
- $where[]=['pid',"=",$pid];
|
|
|
+ $data = Db::name("exclusive")->where($where)->select();
|
|
|
+ $vmp = [];
|
|
|
+ foreach ($data as $sts){
|
|
|
+ $vmp[]=coco($sts);
|
|
|
}
|
|
|
- $status=isset($this->post['status']) && $this->post['status'] !==""? intval($this->post['status']) :"";
|
|
|
- if($status!==""){
|
|
|
- $where[]=['status',"=",$status];
|
|
|
- }
|
|
|
- $level=isset($this->post['level']) && $this->post['level'] !==""? intval($this->post['level']) :"";
|
|
|
- if($level!==""){
|
|
|
- $where[]=['level',"=",$level];
|
|
|
- }
|
|
|
- $list = Db::name("exclusive")->where($where)->select();
|
|
|
- return app_show(0,"获取成功",$list);
|
|
|
-// $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) :"";
|
|
|
-// if($id==""){
|
|
|
-// return error_show(1002,"参数id不能为空");
|
|
|
-// }
|
|
|
-// $idinfo = Db::name('exclusive')->where(['id'=>$id])->find();
|
|
|
-// if($idinfo==""){
|
|
|
-// return error_show(1002,"未找到数据");
|
|
|
-// }
|
|
|
-// return app_show(0,"获取成功",$idinfo);
|
|
|
+ return app_show(0,"获取成功",$vmp);
|
|
|
}
|
|
|
+
|
|
|
// public function edit(){
|
|
|
// $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']):"";
|
|
|
// if($id==""){
|