Good day! Tell me how to mix data exactly by the date of publication, and not by section? Everything is displayed, moreover, in time, but this way: first News 10 news, then Directway 10 news and so on ... and you need one tape and a row by date.
There is a widget:
public function run() { $items = array_merge( News::find() ->where(['visible' => 1, 'deleted' => 0]) ->orderBy('time_create DESC') ->limit($this->count) ->all(), Directway::find() ->where(['visible' => 1, 'deleted' => 0]) ->orderBy('time_create DESC') ->limit($this->count) ->all(), Lifestyle::find() ->where(['visible' => 1, 'deleted' => 0]) ->orderBy('time_create DESC') ->limit($this->count) ->all() ); return $this->render('newsList', [ 'items' => $items, ]); } There is a view
<?php foreach ($items as $item): ?> <?= $item->name ?> <?= Yii::$app->formatter->asDatetime($item->time_create, 'dd.MM, HH:mm') ?> <?php endforeach; ?>