作者 lyh

gx

... ... @@ -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){
... ...
... ... @@ -32,6 +32,7 @@ class ProductController extends BaseController
if(isset($this->map['title']) && !empty($this->map['title'])){
$this->map['title'] = ['like','%'.$this->map['title'].'%'];
}
$this->map['project_id'] = $this->user['project_id'];
$filed = ['id', 'project_id', 'title', 'thumb', 'product_type' , 'route' ,'category_id', 'keyword_id', 'status', 'created_uid', 'created_at', 'updated_at'];
$lists = $product->lists($this->map,$this->page,$this->row,$this->order,$filed);
if(!empty($lists['list'])){
... ...