Browse Source

Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix

master
Lemon 5 years ago
parent
commit
eab4866fb5
  1. 12
      app/Service/v3/Implementations/CategoryService.php

12
app/Service/v3/Implementations/CategoryService.php

@ -87,14 +87,12 @@ class CategoryService implements CategoryServiceInterface
$returnData = [];
foreach ($categories as $key => &$category) {
$value = json_decode($category, true);
$iconUrl = $value['icon'];
if(strripos($iconUrl,"http") === false){
$iconUrl = config('alioss.img_host').'/'.$value['icon'];
}
$iconUrl = $this->attachmentService->switchImgToAliOss($iconUrl, OssThumbnail::THUMBNAIL_100_Q90);
$returnData[] = ['id' => $key, 'icon' => $iconUrl , 'name' => $value['name']];
$iconUrl = $this->attachmentService->switchImgToAliOss($value['icon'], OssThumbnail::THUMBNAIL_100_Q90);
$returnData[] = ['id' => $value['id'], 'icon' => $iconUrl , 'name' => $value['name'], 'sort' => $value['sort']];
}
return $returnData;
$returnData = collect($returnData)->sortByDesc('sort')->all();
return array_values($returnData);
}
}
Loading…
Cancel
Save