feat: good
This commit is contained in:
@@ -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")]
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user