Answer the question
In order to leave comments, you need to log in
Why does Yii2 ListView spawn new items in the list?
There is a Product model and a Price associated with it
public function getPrices()
{
return $this->hasMany(Price::class, ['product_id' => 'id']);
}
$query = Product::find()
->joinWith('prices', true , 'LEFT JOIN')
->orderBy(['price.price' => SORT_DESC]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 10,
],
]);
VarDumper::dump($query->all,10,1);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question