|
|
@ -6,15 +6,21 @@ use App\Constants\v3\OssThumbnail; |
|
|
use App\Constants\v3\SsdbKeys; |
|
|
use App\Constants\v3\SsdbKeys; |
|
|
use App\Model\v3\Category; |
|
|
use App\Model\v3\Category; |
|
|
use App\Model\v3\Goods; |
|
|
use App\Model\v3\Goods; |
|
|
use App\Model\v3\GoodsType; |
|
|
|
|
|
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; |
|
|
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
|
|
|
|
|
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 +91,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']]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|