where(['merchantId' =>$this->merchantId]); $query->orderBy('id desc'); $countQuery = clone $query; $pages = new Pagination(['totalCount' => $countQuery->count(),'pageSize' => 20]); $models = $query->offset($pages->offset)->limit($pages->limit)->all(); return $this->render('list', ['models' => $models,'pages' => $pages]); } public function actionShow() { return $this->render('show'); } }