作者 lyh

gx

... ... @@ -27,19 +27,19 @@ class CategoryLogic extends BaseLogic
$this->model = new Category();
}
public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20)
{
$data = parent::getList($map, $sort, $columns, $limit);
foreach ($data as &$v){
$v['url'] = $this->getProjectDomain() . $v['route'] ;
$v['product_num'] = $this->getProductNum($v['id']);
$v['image_link'] = getImageUrl($v['image']);
}
if(!$map){
$data = Arr::listToTree($data);
}
return $this->success($data);
}
// public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20)
// {
// $data = parent::getList($map, $sort, $columns, $limit);
// foreach ($data as &$v){
// $v['url'] = $this->getProjectDomain() . $v['route'] ;
// $v['product_num'] = $this->getProductNum($v['id']);
// $v['image_link'] = getImageUrl($v['image']);
// }
// if(!$map){
// $data = Arr::listToTree($data);
// }
// return $this->success($data);
// }
public function getInfo($id)
{
... ...