hasOne(VehicleNewAttributeCategoriesTranslationModel::class, 'categories_id')->where('locale', locale()); } /** * 多条翻译 */ public function translations() { return $this->hasMany(VehicleNewAttributeCategoriesTranslationModel::class, 'categories_id'); } public function attribute() { return $this->hasMany(VehicleNewAttributesModel::class, 'category_id', 'id'); } }