/** * Lists all Stock models. * @return mixed */ public function actionIndex() { //$dataProvider = new ActiveDataProvider([ // 'query' => Stock::find(), //]); $dataProvider = Stock::find()->where(['on' => 1])->all(); return $this->render('index', ['dataProvider' => $dataProvider]); }
/** * Lists all Stock models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Stock::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }