getFilterData('and');
$filter[0] = 'and';
TableWidget::widget([
'top' => [
'title' => 'Хронология',
'data' => [
'index/dashboard' => 'Начало',
]
],
//'filter' => [
// [
// 'name' => ['Име на туристическия обект', 'c4'],
// ],
//],
'actions' => [],
'th' => [
'№' => 'c0 text-right',
'Потребител' => '',
'Действие' => '',
'Какво' => '',
'Дата и час' => '',
],
'model' => History::class,
'data' => History::find()->where(Yii::$app->getFilterData('and'))->orderBy(['date_time' => SORT_DESC])->loop([
'id',
'user',
function (History $h) {
switch ($h->action) {
case 1:
return ' Въвеждане';
case 2:
return ' Редакция';
}
},
function(History $h) {
return $h->table_name.' ID:'.$h->history_id;
},
function (History $h) {
return $h->formatDate($h->date_time, 'd.m.Y H:i');
}
], $_GET['p'] ?? 1, 50)
]);