港口翻译
This commit is contained in:
@@ -5,6 +5,8 @@ namespace app\admin\service;
|
||||
use app\admin\validate\VehColorValidate;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\model\VehColor;
|
||||
use app\common\utils\translation\service\TranslationService;
|
||||
use app\queue\utils\Translat;
|
||||
|
||||
class VehColorService
|
||||
{
|
||||
@@ -21,6 +23,8 @@ class VehColorService
|
||||
*/
|
||||
protected $validator = VehColorValidate::class;
|
||||
|
||||
public $translatFields = ['color_text'];
|
||||
|
||||
/**
|
||||
* 获取验证器
|
||||
*/
|
||||
@@ -28,4 +32,18 @@ class VehColorService
|
||||
{
|
||||
return new $this->validator;
|
||||
}
|
||||
|
||||
public function afterServiceStore($res)
|
||||
{
|
||||
$sourceLocale = locale();
|
||||
$data = $res->toArray();
|
||||
$traitsourceFields = Translat::extractSourceFields($data, $this->translatFields);
|
||||
|
||||
(new TranslationService())->queueTranslations(
|
||||
'veh_color_translation',
|
||||
$res['id'],
|
||||
$sourceLocale,
|
||||
$traitsourceFields
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user