public function actionIndex() { $bannerList = Material::find()->where(['materialId' => Variable::$materialId_proBanner])->orderBy('sort ASC')->all(); $model = Material::findOne(['materialId' => Variable::$materialId_productVideo]); $list = Material::findAll(['materialId' => Variable::$materialId_auth]); return $this->render(FVariable::$productIndex_view, ['model' => $model, 'list' => $list, 'bannerList' => $bannerList]); }
public function findByProductId($id) { $MaterialAll = Material::find()->where(array('useId' => $id))->all(); if (!$MaterialAll) { return false; } return $MaterialAll; }
public function actionIndex() { $bannerList = Material::find()->where(['materialId' => Variable::$materialId_banner])->orderBy('sort ASC')->all(); $articleList = Article::find()->where(['categoryId' => Variable::$articleCat_type_news]); $articleList->orderBy('isIndexShow DESC'); $articleList = $articleList->limit(4)->all(); // print_r($bannerList); return $this->render(FVariable::$home_view, ['bannerList' => $bannerList, 'articleList' => $articleList]); }