title = 'Подписи фото'; $this->params['breadcrumbs'][] = ['label' => 'Новости', 'url' => ['list']]; $this->params['breadcrumbs'][] = $this->title; $page = trim(Yii::$app->request->get('page')); //SELECT DISTINCT SUBSTRING_INDEX(LOWER(`photo_title`),':', -1) as `ph`, count(*) FROM `news` WHERE `photo_title` != '' && `photo_title` != "''" group by ph $sql ="SELECT DISTINCT SUBSTRING_INDEX(LOWER(`photo_title`),':', -1) as `ph`, count(*) as c FROM `news` WHERE `photo_title` != '' and `photo_title` != '\'\'' and `dt_pub` > '".Yii::$app->params['delPhotoE']."' group by ph order by c DESC"; //$query = ActiveRecord::findBySql($sql); // print_r($query->asArray()->All()); //$countSql = 'select count(*) ' . $sql; $dataProvider = new SqlDataProvider([ 'sql' => $sql, // 'totalCount' => Yii::$app->db->createCommand($countSql)->queryScalar(), 'pagination' => [ 'pageSize' => 30, ], ]); if ($this->beginCache('fdfsdtf_'.$page, ['duration' => 3600])) { ?>
$dataProvider, 'options' => [ 'tag' => "div", 'class' => 'list-wrapper', 'id' => 'list-wrapper', ], "itemOptions"=>[ "tag"=>"tr",'class' => 'dtr-control', ], "itemView" => "_itemtitle", "layout" => "\n{items}\n{pager}\n{summary}", 'pager' => [ 'prevPageCssClass' => 'page-item', 'firstPageLabel' => 'Начало', 'lastPageLabel' => 'Конец', 'linkOptions' => [ 'class'=>'page-link'], 'pageCssClass' => 'page-item', 'disabledListItemSubTagOptions' => ['tag' => 'a', 'class' => 'page-link'], ] ]) ?>
Заголовки Материалов
endCache(); }