D
D
Dmitry Bay2016-07-08 08:48:46
MySQL
Dmitry Bay, 2016-07-08 08:48:46

How to use orderBy() when using Join in yii2?

You need to sort the records by the attached table. How can I do that? The following construct does not work...

$entries = EntryItems::find()->where(['acc_id'=>$model->id,'entry.status'=>Entry::STATUS_ACTIVE]) ->innerJoin('entry','entry.id=entry_items.id')->orderBy('entry.date_paid')->with('entry')->all();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question