|
...
|
...
|
@@ -25,9 +25,20 @@ class CategoryController extends BaseController |
|
|
|
if(!empty($this->map['title'])){
|
|
|
|
$this->map['title'] = ['like','%'.$this->map['title'].'%'];
|
|
|
|
}
|
|
|
|
$this->map['project_id'] = $this->user['project_id'];
|
|
|
|
$filed = ['id', 'project_id', 'pid', 'title', 'image', 'keywords', 'describe', 'status','created_at'];
|
|
|
|
$data = $category->lists($this->map,$this->page,$this->row,$this->order,$filed);
|
|
|
|
return $this->response('success',Code::SUCCESS,$data);
|
|
|
|
$data = $category->list($this->map,'id',$filed);
|
|
|
|
if(!empty($data)){
|
|
|
|
$list = array();
|
|
|
|
foreach ($data as $v){
|
|
|
|
$v = (array)$v;
|
|
|
|
if ($v['pid'] == 0) {
|
|
|
|
$v['sub'] = _get_child($v['id'], $data);
|
|
|
|
$list[] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->response('success',Code::SUCCESS,$list);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function info(Request $request, CategoryLogic $logic){
|
...
|
...
|
|