belongsTo(BrandModel::class, 'brand_id'); } /** * 单条翻译 */ public function translation() { return $this->hasOne(BrandBannerTranslationModel::class, 'banner_id')->where('locale', locale()); } /** * 多条翻译 */ public function translations() { return $this->hasMany(VehicleDataTranslationModel::class, 'banner_id'); } const TRANS_FIELDS = [ 'alt' ]; }