| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace backend\controllers;
- use common\models\xhTrainStudent;
- use Yii;
- use yii\web\Controller;
- use yii\filters\AccessControl;
- use yii\data\Pagination;
- /**
- * student controller
- */
- class StudentController extends BackendController
- {
- public function actionList()
- {
- $query = xhTrainStudent::find();
- $query->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');
- }
- }
|