public function actionList($stype = null, $sword = null) { $query = SiteModule::find()->where(['site_id' => $this->module->siteId, 'type' => SiteModule::TYPE_MENU])->orderby('created_at desc'); if ($sword !== null) { $query->andWhere(['like', "{$stype}", $sword]); } $pagination = new Pagination(['totalCount' => $query->count()]); $items = $query->offset($pagination->offset)->limit($pagination->limit)->all(); return $this->render($this->action->id, ['stype' => $stype, 'sword' => $sword, 'items' => $items, 'pagination' => $pagination]); }