0
Ich habe Car
Modell mit Bezug auf Brand
Modell von brand-id
:Was mache ich falsch, wenn ich eine Beziehung suche?
public function getBrand() {
return $this->hasOne(Brand::className(), [
'id' => 'brand_id'
]);
}
Marke Modell Name Feld hat. Und ich möchte nach diesem Feld suchen. Ich tue dies:
$query->joinWith('brand');
$query->orFilterWhere([
'like', 'brand.name', '%'.$this->company.'%', false
]);
von company
Feld Suchen.
Marke Modell table_name ist car_brand
Was mache ich falsch?