Exemplo n.º 1
0
 /**
  * Lists all SourceRatio models.
  * @return mixed
  */
 public function actionIndex()
 {
     $params = Yii::$app->request->get();
     $query = SourceRatio::find();
     #$query->where(['status' => Basic::STATUS_NORMAL]);
     if (isset($params['title'])) {
         $query->andWhere(['like', 'basic_title', $params['title']]);
     }
     if (isset($params['match_status']) && $params['match_status'] != 99) {
         $query->andWhere(['status' => $params['match_status']]);
     }
     $countQuery = clone $query;
     $pages = new Pagination(['totalCount' => $countQuery->count()]);
     $data = $query->offset($pages->offset)->orderBy(['update_time' => SORT_DESC])->limit($pages->limit)->all();
     return $this->render('index', ['data' => $data, 'pages' => $pages, 'params' => $params]);
 }