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