|
@@ -25,9 +25,20 @@ class CategoryController extends BaseController |
|
@@ -25,9 +25,20 @@ class CategoryController extends BaseController |
|
25
|
if(!empty($this->map['title'])){
|
25
|
if(!empty($this->map['title'])){
|
|
26
|
$this->map['title'] = ['like','%'.$this->map['title'].'%'];
|
26
|
$this->map['title'] = ['like','%'.$this->map['title'].'%'];
|
|
27
|
}
|
27
|
}
|
|
|
|
28
|
+ $this->map['project_id'] = $this->user['project_id'];
|
|
28
|
$filed = ['id', 'project_id', 'pid', 'title', 'image', 'keywords', 'describe', 'status','created_at'];
|
29
|
$filed = ['id', 'project_id', 'pid', 'title', 'image', 'keywords', 'describe', 'status','created_at'];
|
|
29
|
- $data = $category->lists($this->map,$this->page,$this->row,$this->order,$filed);
|
|
|
|
30
|
- return $this->response('success',Code::SUCCESS,$data);
|
30
|
+ $data = $category->list($this->map,'id',$filed);
|
|
|
|
31
|
+ if(!empty($data)){
|
|
|
|
32
|
+ $list = array();
|
|
|
|
33
|
+ foreach ($data as $v){
|
|
|
|
34
|
+ $v = (array)$v;
|
|
|
|
35
|
+ if ($v['pid'] == 0) {
|
|
|
|
36
|
+ $v['sub'] = _get_child($v['id'], $data);
|
|
|
|
37
|
+ $list[] = $v;
|
|
|
|
38
|
+ }
|
|
|
|
39
|
+ }
|
|
|
|
40
|
+ }
|
|
|
|
41
|
+ return $this->response('success',Code::SUCCESS,$list);
|
|
31
|
}
|
42
|
}
|
|
32
|
|
43
|
|
|
33
|
public function info(Request $request, CategoryLogic $logic){
|
44
|
public function info(Request $request, CategoryLogic $logic){
|