Merge branch 'feature/article' into develop
# Conflicts: # app/console/service/VehicleNewSkusService.php
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace app\console\service;
|
||||
|
||||
use app\console\model\ModelModel;
|
||||
use app\console\model\ModelTranslationModel;
|
||||
use app\mzl\common\services\BaseService;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -122,6 +123,13 @@ class ModelService extends BaseService
|
||||
$sourceLocale,
|
||||
$sourceFields
|
||||
);
|
||||
ModelTranslationModel::updateOrCreate(
|
||||
[
|
||||
'model_id' => $id,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$sourceFields
|
||||
);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
|
||||
@@ -6,6 +6,7 @@ use app\console\model\DraftsModel;
|
||||
use app\console\model\VehicleApplyModel;
|
||||
use app\apis\model\VehicleAlbumModel;
|
||||
use app\console\model\VehicleDataModel;
|
||||
use app\console\model\VehicleDataTranslationModel;
|
||||
use app\mzl\common\org\XunfeiFanyi;
|
||||
use app\mzl\common\services\BaseService;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -243,10 +244,17 @@ class VehicleDataService extends BaseService
|
||||
}
|
||||
|
||||
// 异步翻译并写入 hs_vehicle_data_translation 表
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicle',
|
||||
$id,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicle',
|
||||
// $id,
|
||||
// $sourceLocale,
|
||||
// $sourceFields
|
||||
// );
|
||||
VehicleDataTranslationModel::updateOrCreate(
|
||||
[
|
||||
'vehicle_id' => $id,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$sourceFields
|
||||
);
|
||||
|
||||
|
||||
@@ -3,12 +3,17 @@
|
||||
namespace app\console\service;
|
||||
|
||||
use app\console\model\VehicleNewAlbumModel;
|
||||
use app\console\model\VehicleNewAlbumTranslationModel;
|
||||
use app\console\model\VehicleNewAskedModel;
|
||||
use app\console\model\VehicleNewAskedTranslationModel;
|
||||
use app\console\model\VehicleNewContentModel;
|
||||
use app\console\model\VehicleNewContentTranslationModel;
|
||||
use app\console\model\VehicleNewModel;
|
||||
use app\console\model\VehicleNewSkuAttributesModel;
|
||||
use app\console\model\VehicleNewSkusModel;
|
||||
use app\console\model\VehicleNewTraitModel;
|
||||
use app\console\model\VehicleNewTraitTranslationModel;
|
||||
use app\console\model\VehicleNewTranslationModel;
|
||||
use app\mzl\common\services\BaseService;
|
||||
use app\mzl\modules\translation\service\TranslationService;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -279,10 +284,17 @@ class VehicleNewService extends BaseService
|
||||
}
|
||||
|
||||
// 异步翻译并写入 hs_vehicle_data_translation 表
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicleNew',
|
||||
$id,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicleNew',
|
||||
// $id,
|
||||
// $sourceLocale,
|
||||
// $sourceFields
|
||||
// );
|
||||
VehicleNewTranslationModel::updateOrCreate(
|
||||
[
|
||||
'vehicle_id' => $id,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$sourceFields
|
||||
);
|
||||
|
||||
@@ -306,10 +318,17 @@ class VehicleNewService extends BaseService
|
||||
$askedId = $asked_res->id;
|
||||
$askedsId[] = $askedId;
|
||||
}
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicleNewAsked',
|
||||
$askedId,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicleNewAsked',
|
||||
// $askedId,
|
||||
// $sourceLocale,
|
||||
// $askedsourceFields
|
||||
// );
|
||||
VehicleNewAskedTranslationModel::updateOrCreate(
|
||||
[
|
||||
'asked_id' => $askedId,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$askedsourceFields
|
||||
);
|
||||
}
|
||||
@@ -335,10 +354,17 @@ class VehicleNewService extends BaseService
|
||||
$traitId = $trait_res->id;
|
||||
$traitsId[] = $traitId;
|
||||
}
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicleNewTrait',
|
||||
$traitId,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicleNewTrait',
|
||||
// $traitId,
|
||||
// $sourceLocale,
|
||||
// $traitsourceFields
|
||||
// );
|
||||
VehicleNewTraitTranslationModel::updateOrCreate(
|
||||
[
|
||||
'trait_id' => $traitId,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$traitsourceFields
|
||||
);
|
||||
}
|
||||
@@ -371,10 +397,17 @@ class VehicleNewService extends BaseService
|
||||
$albumsId[] = $albumId;
|
||||
}
|
||||
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicleNewAlbum',
|
||||
$albumId,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicleNewAlbum',
|
||||
// $albumId,
|
||||
// $sourceLocale,
|
||||
// $albumsourceFields
|
||||
// );
|
||||
VehicleNewAlbumTranslationModel::updateOrCreate(
|
||||
[
|
||||
'album_id' => $albumId,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$albumsourceFields
|
||||
);
|
||||
}
|
||||
@@ -407,10 +440,17 @@ class VehicleNewService extends BaseService
|
||||
$contentsId[] = $contentId;
|
||||
}
|
||||
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicleNewContent',
|
||||
$contentId,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicleNewContent',
|
||||
// $contentId,
|
||||
// $sourceLocale,
|
||||
// $contentsourceFields
|
||||
// );
|
||||
VehicleNewContentTranslationModel::updateOrCreate(
|
||||
[
|
||||
'content_id' => $contentId,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$contentsourceFields
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace app\console\service;
|
||||
use app\console\model\VehicleNewAttributeValuesModel;
|
||||
use app\console\model\VehicleNewSkuAttributesModel;
|
||||
use app\console\model\VehicleNewSkusModel;
|
||||
use app\console\model\VehicleNewSkusTranslationModel;
|
||||
use app\mzl\common\services\BaseService;
|
||||
use app\mzl\modules\translation\service\TranslationService;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -137,10 +138,17 @@ class VehicleNewSkusService extends BaseService
|
||||
}
|
||||
|
||||
//异步翻译并写入 hs_vehicle_new_skus_translation 表
|
||||
(new TranslationService())->queueTranslations(
|
||||
'vehicleNewSku',
|
||||
$id,
|
||||
$sourceLocale,
|
||||
// (new TranslationService())->queueTranslations(
|
||||
// 'vehicleNewSku',
|
||||
// $id,
|
||||
// $sourceLocale,
|
||||
// $sourceFields
|
||||
// );
|
||||
VehicleNewSkusTranslationModel::updateOrCreate(
|
||||
[
|
||||
'sku_id' => $id,
|
||||
'locale' => $sourceLocale,
|
||||
],
|
||||
$sourceFields
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user