| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?php
- namespace teach\controllers;
- use common\models\xhTrainTeacher;
- use common\services\xhPictureCategoryService;
- use common\services\xhSetMealService;
- use common\services\xhInviteService;
- use common\services\xhMerchantAccountService;
- use common\services\xhMerchantService;
- use common\components\weixinUtil;
- use common\components\configDict;
- use common\components\stringUtil;
- use common\components\util;
- use common\services\xhAdminService;
- use common\services\xhCommonService;
- use common\services\xhApplyOrderService;
- use common\services\xhPictureService;
- use common\services\xhTrainClassService;
- use Yii;
- use yii\web\Controller;
- class MainController extends Controller
- {
- public $withoutLogin = ['index'];
- public $focusImg=[];
- public function beforeAction($action){
- $respond = xhPictureService::getPictureList(['categoryId' => 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]);
- }
- }
|