hasOne(VehicleNewTranslationModel::class, 'vehicle_id')->where('locale', locale()); } /** * 多条翻译 */ public function translations() { return $this->hasMany(VehicleNewTranslationModel::class, 'vehicle_id'); } public function brand() { return $this->belongsTo(BrandModel::class, 'brand'); } public function models() { return $this->belongsTo(ModelModel::class, 'model'); } public function location() { return $this->belongsTo(LocationModel::class, 'location'); } public function types() { return $this->belongsTo(TypesModel::class, 'type', 'id'); } public function energy() { return $this->belongsTo(EnergyModel::class, 'energy', 'id'); } public function album() { return $this->hasMany(VehicleNewAlbumModel::class, 'vehicle_id', 'id'); } public function asked() { return $this->hasMany(VehicleNewAskedModel::class, 'vehicle_id', 'id'); } public function trait() { return $this->hasMany(VehicleNewTraitModel::class, 'vehicle_id', 'id'); } public function content() { return $this->hasMany(VehicleNewContentModel::class, 'vehicle_id', 'id'); } }