10],true); $focus = $respond['model']; $this->focusImg = $focus; return parent::beforeAction($action); } public function actionIndex() { return $this->render('index'); } public function actionCourse() { $merchantId = 1; $matchInfo = [ 1 => ['url' => './start-up', 'background' => 'couse1.jpg'], 2 => ['url' => './pursue', 'background' => 'couse3.jpg'], 3 => ['url' => './wedding', 'background' => 'couse2.jpg'], 4 => ['url' => './interest', 'background' => 'couse4.jpg'], 5 => ['url' => './diy', 'background' => 'couse5.jpg'], 6 => ['url' => './balloon', 'background' => 'couse5.jpg'], ]; $class = xhTrainClassService::getAllClass($merchantId); return $this->render('course', ['class' => $class, 'matchInfo' => $matchInfo]); } public function actionAbout() { //学校荣誉 $honorRespond = xhPictureService::getPictureList(['categoryId' => 9],true); $honor = $honorRespond['model']; if (count($honor) % 2 == 1) { array_pop($honor); } $packageHonor = array_chunk($honor, 2); return $this->render('about',['honor'=>$packageHonor]); } public function actionSign() { $this->layout = 'sign'; return $this->render('sign'); } public function actionStudent() { $pageSize = Yii::$app->request->get('pageSize', 6); $categoryId = Yii::$app->request->get('categoryId', 1); $data = ['pageSize' => $pageSize, 'categoryId' => $categoryId]; $respond = xhPictureService::getPictureList($data); $models = $respond['model']; $merchantId = 1; $category = xhPictureCategoryService::getStudent($merchantId); $arrImg = [ 1 => '/images/glhs/flow1.png', 2 => '/images/glhs/flow31.png', 3 => '/images/glhs/flow4.png', ]; return $this->render('student', ['models' => $models, 'category' => $category, 'categoryId' => $categoryId, 'arrImg' => $arrImg]); } public function actionGetPicture() { $get = Yii::$app->request->get(); $respond = xhPictureService::getPictureList($get); $models = $respond['model']; util::successInfo('操作成功', 'A0001', $models); } public function actionShop() { return $this->render('shop'); } public function actionTeacher() { $data = xhTrainTeacher::find()->where(['merchantId'=>1])->asArray()->all(); return $this->render('teacher',['data'=>$data]); } public function actionWorks() { $category = ['wedding' => 4, 'meeting' => 5, 'bouquet' => 6, 'basket' => 7, 'weddingSet' => 8]; //婚礼 $respond = xhPictureService::getPictureList(['categoryId' => $category['wedding']],true); $wedding = $respond['model']; //会议 $meetingRespond = xhPictureService::getPictureList(['categoryId' => $category['meeting']],true); $meeting = $meetingRespond['model']; //花束 $bouquetRespond = xhPictureService::getPictureList(['categoryId' => $category['bouquet']],true); $bouquet = $bouquetRespond['model']; if (count($bouquet) % 2 == 1) { array_pop($bouquet); } $packageBouquet = array_chunk($bouquet, 2); //礼篮 $basketRespond = xhPictureService::getPictureList(['categoryId' => $category['basket']],true); $basket = $basketRespond['model']; if (count($basket) % 2 == 1) { array_pop($basket); } $packageBasket = array_chunk($basket, 2); //婚礼套餐 $weddingSetRespond = xhPictureService::getPictureList(['categoryId' => $category['weddingSet']],true); $weddingSet = $weddingSetRespond['model']; if (count($weddingSet) % 2 == 1) { array_pop($weddingSet); } $packageWedding = array_chunk($weddingSet, 2); return $this->render('works', [ 'wedding' => $wedding, 'meeting' => $meeting, 'bouquet' => $packageBouquet, 'basket' => $packageBasket, 'weddingSet' => $packageWedding, ]); } public function actionGuide() { return $this->render('guide'); } public function actionStartUp() { $this->layout = 'sign'; $info = xhTrainClassService::getById(1); return $this->render('startUp', ['info' => $info]); } public function actionWedding() { $this->layout = 'sign'; $info = xhTrainClassService::getById(3); return $this->render('wedding', ['info' => $info]); } public function actionPursue() { $this->layout = 'sign'; $info = xhTrainClassService::getById(2); return $this->render('pursue', ['info' => $info]); } public function actionBalloon() { $this->layout = 'sign'; $info = xhTrainClassService::getById(6); return $this->render('balloon', ['info' => $info]); } public function actionInterest() { $this->layout = 'sign'; $info = xhTrainClassService::getById(4); return $this->render('interest', ['info' => $info]); } public function actionDiy() { $this->layout = 'sign'; $info = xhTrainClassService::getById(5); return $this->render('diy', ['info' => $info]); } }