Yii
0
Вклад в тег
$count = $model->find()
->joinWith('artStatus')
->andWhere('{{status}}.code = :code', [':code' => $code])
->count();
return new SqlDataProvider([
'totalCount' => $count,
'params' => [':code' => $code],
'sql' => '
SELECT article.*, status.code, status.descr AS sdescr
FROM article
LEFT JOIN status ON article.id_status = status.id
WHERE status.code = :code'
]);