品牌
This commit is contained in:
@@ -38,10 +38,10 @@ class BrandService extends BaseService
|
||||
'fields' => ['id', 'status', 'sort', 'toppic', 'descpic', 'logo', 'letter', 'is_hot', 'created_at', 'updated_at'],
|
||||
'relations' => [
|
||||
'translation' => ['brand_id', 'name', 'desc','toppic_alt','descpic_alt','logo_alt'],
|
||||
'banner' => ['id', 'pic', 'sort',],
|
||||
'banner.translation' => ['id', 'alt',],
|
||||
'trait' => ['id', 'sort',],
|
||||
'trait.translation' => ['id', 'title', 'content',],
|
||||
'banners' => ['id', 'pic', 'sort',],
|
||||
'banners.translation' => ['id', 'alt',],
|
||||
'traits' => ['id', 'sort',],
|
||||
'traits.translation' => ['id', 'title', 'content',],
|
||||
],
|
||||
'sorts' => [
|
||||
['field' => 'id', 'direction' => 'desc']
|
||||
@@ -114,7 +114,7 @@ class BrandService extends BaseService
|
||||
if (!$banner) {
|
||||
throw new BusinessException('提交失败');
|
||||
}
|
||||
|
||||
// 异步翻译并写入 hs_brand_banner_translation 表
|
||||
(new TranslationService())->queueTranslations(
|
||||
'brandBanner',
|
||||
$banner->id,
|
||||
@@ -185,6 +185,7 @@ class BrandService extends BaseService
|
||||
foreach ($banners as $banner) {
|
||||
$bannersourceFields = $BrandBannerService->extractSourceFields($banner);
|
||||
$bannersourceFields['brand_id'] = $id;
|
||||
$banner['brand_id'] = $id;
|
||||
|
||||
if(!empty($banner['id'])){
|
||||
$bannerId = $banner['id'];
|
||||
@@ -217,6 +218,7 @@ class BrandService extends BaseService
|
||||
foreach ($traits as $trait) {
|
||||
$traitsourceFields = $BrandTraitService->extractSourceFields($trait);
|
||||
$traitsourceFields['brand_id'] = $id;
|
||||
$trait['brand_id'] = $id;
|
||||
|
||||
if(!empty($trait['id'])){
|
||||
$traitId = $trait['id'];
|
||||
|
||||
Reference in New Issue
Block a user