ActivityController.php 2.8 KB
<?php
/**
 * 同期活动
 * Author : xiaojie
 * DateTime: 2018/12/06 11:39
 */
namespace app\portal\controller;

use app\portal\model\PageModel;
use app\portal\model\PortalCategoryModel;
use app\portal\model\ShowModel;
use cmf\controller\HomeBaseController;


class ActivityController extends HomeBaseController
{
    /**
     * 专业论坛(汽车产业装备与智能制造峰会)
     * portal/activity/forum
     */
    public function forum()
    {
        return $this->fetch();
    }

    /**
     * 现场活动
     * portal/activity/scene
     */
    public function scene()
    {
        $cate_id = 34;
        $showModel = new ShowModel();
        $list = $showModel->getList($cate_id);
        //分页样式
        $page = $this->getPageStyle($list);
        //所在位置
        $location = [
            [
                'location' => '同期活动',
                'url' => 'javascript:;'
            ],
            [
                'location' => '现场活动',
                'url' => url('portal/activity/scene')
            ]
        ];
        $this->assign('list',$list);
        $this->assign('location',$location);
        $this->assign('page',$page);
        $this->assign('menu_id',40);
        return $this->fetch(':list');
    }

    /**
     * 现场活动详情
     * portal/activity/scene_detail
     */
    public function scene_detail()
    {
        $id = $this->request->param('id','','intval');
        $location1 = $this->request->param('location1','');
        $location2 = $this->request->param('location2','');
        $showModel = new ShowModel();
        $info = $showModel->getDetail($id);
        $this->setShowNum($info['id']);
        //所在位置
        $location = [
            [
                'location' => $location1,
                'url' => 'javascript:;'
            ],
            [
                'location' => $location2.'详情',
                'url' => 'javascript:;'
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':page');
    }

    /**
     * 采购对接会
     * portal/activity/purchase
     */
    public function purchase()
    {
        $cate_id = 35;
        $showModel = new ShowModel();
        //列表信息
        $list = $showModel->getList($cate_id);
        //分页样式
        $page = $this->getPageStyle($list);
        //所在位置
        $location = [
            [
                'location' => '同期活动',
                'url' => 'javascript:;'
            ],
            [
                'location' => '采购对接会',
                'url' => 'javascript:;'
            ]
        ];
        $this->assign('list',$list);
        $this->assign('location',$location);
        $this->assign('page',$page);
        $this->assign('menu_id',41);
        return $this->fetch(':list');
    }
}