/** * Lists all SystemLog models. * @return mixed * @throws \yii\base\InvalidParamException */ public function actionIndex() { $searchModel = new SystemLogSearch(); $dataProvider = $searchModel->search(\Yii::$app->request->queryParams); if (strcasecmp(\Yii::$app->request->method, 'delete') === 0) { SystemLog::deleteAll($dataProvider->query->where); return $this->refresh(); } $dataProvider->sort = ['defaultOrder' => ['log_time' => SORT_DESC]]; return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }