/**
* 分类列表
* @return JsonResponse|object
*/
public function getCategoryList()
{
$where[] = ['status', $this->param['status']];
$categoryList = $this->shopCateRepo->getCategoryList($where);
$all = [
'id' => 0,
'name_zh_cn' => '全部',
'name_en_us' => '',
'image' => '',
'attr_specs' => [],
'shop_count' => $this->shopRepo->findCount(['status' => 1]),
];
$categoryList->prepend($all);//在集合首部追加元素
return ApiResponse::Success($categoryList);
}
标签: laravel