weigang 6 years ago
parent
commit
79dcd8be87
  1. 9
      app/Service/v3/Implementations/CategoryService.php

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

@ -8,6 +8,7 @@ use App\Model\v3\Category;
use App\Model\v3\Goods; use App\Model\v3\Goods;
use App\Model\v3\GoodsType; use App\Model\v3\GoodsType;
use App\Model\v3\StoreType; use App\Model\v3\StoreType;
use App\Service\v3\Interfaces\AttachmentServiceInterface;
use App\Service\v3\Interfaces\CategoryServiceInterface; use App\Service\v3\Interfaces\CategoryServiceInterface;
use App\TaskWorker\SSDBTask; use App\TaskWorker\SSDBTask;
use Hyperf\Utils\ApplicationContext; use Hyperf\Utils\ApplicationContext;
@ -15,6 +16,12 @@ use Hyperf\Utils\ApplicationContext;
class CategoryService implements CategoryServiceInterface class CategoryService implements CategoryServiceInterface
{ {
/**
* @Inject
* @var AttachmentServiceInterface
*/
protected $attachmentService;
public function do() public function do()
{ {
// TODO: Implement do() method. // TODO: Implement do() method.
@ -85,7 +92,7 @@ class CategoryService implements CategoryServiceInterface
if(strripos($iconUrl,"http") === false){ if(strripos($iconUrl,"http") === false){
$iconUrl = config('alioss.img_host').'/'.$value['icon']; $iconUrl = config('alioss.img_host').'/'.$value['icon'];
} }
$iconUrl = $iconUrl . OssThumbnail::THUMBNAIL_100_Q50;
$iconUrl = $this->attachmentService->switchImgToAliOss($iconUrl, OssThumbnail::THUMBNAIL_100_Q90);
$returnData[] = ['id' => $key, 'icon' => $iconUrl , 'name' => $value['name']]; $returnData[] = ['id' => $key, 'icon' => $iconUrl , 'name' => $value['name']];
} }

Loading…
Cancel
Save