ich drei Datenbanktabelle haben:Active wo und Ordnung auf über Tisch
Produkt (id, name)
product_has_adv (Produkt, Vorteil, sortieren, wichtig)
Vorteil (id, Text
)In Product I definiert sind dies:
public function getAdvantages()
{
return $this->hasMany(AdvantageModel::className(), ['id' => 'advantage'])
->viaTable('product_has_advantage', ['product' => 'id']);
}
ich erhalte die advanta ges ohne Probleme.
Aber jetzt muss ich hinzufügen, wo product_has_advantage.important = 1 clausel und auch die Vorteile durch die Sortierung-columen in der product_has_advantage-Tabelle sortieren.
Wie und wo muss ich es realisieren?
siehe meine Antwort: http://stackoverflow.com/a/41539132/800639 –