diff --git a/app/Controller/Admin/GoodController.php b/app/Controller/Admin/GoodController.php index a9cdb3c..a108273 100644 --- a/app/Controller/Admin/GoodController.php +++ b/app/Controller/Admin/GoodController.php @@ -156,6 +156,7 @@ class GoodController /** * category 列表 + * @param categoryRequest $request * @return array */ #[RequestMapping(path: "list_category", methods: "GET")] @@ -169,6 +170,7 @@ class GoodController * category 添加 * @param categoryRequest $request * @return array + * @throws Exception */ #[RequestMapping(path: "add_category", methods: "POST")] #[Scene(scene: "add_category")] diff --git a/app/Service/Admin/Good/CategoryService.php b/app/Service/Admin/Good/CategoryService.php index 8340811..7e3b553 100644 --- a/app/Service/Admin/Good/CategoryService.php +++ b/app/Service/Admin/Good/CategoryService.php @@ -36,7 +36,16 @@ class CategoryService extends BaseService if (empty($list)) return $this->return->success('success',['list' => []]); - return $this->return->success('success',['list' => $list->toArray()]); + $res = $list->toArray(); + + $ossIds = array_column($res['data'],'image_id'); + $ossInfo = $this->getOssObjects($ossIds); + foreach ($res['data'] as &$one) + { + $one['url'] = $ossInfo[$one['image_id']]['url']; + } + + return $this->return->success('success',['list' => $res]); } /**