ExhibitionController.php 8.0 KB
<?php
/**
 * 关于展会
 * Author : xiaojie
 * DateTime: 2018/12/06 10:35
 */
namespace app\portal\controller;

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

class ExhibitionController extends HomeBaseController
{

    /**
     * 展会介绍
     * portal/exhibition/introduce
     */
    public function introduce()
    {
        $cate_id = 8;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '展会介绍',
                'url' => url('portal/exhibition/introduce')
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':page');
    }

    /**
     * 展品范围
     * portal/exhibition/range
     */
    public function range()
    {
        $cate_id = 9;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '展品范围',
                'url' => url('portal/exhibition/range')
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':page');
    }

    /**
     * 零部件展览
     * portal/exhibition/range
     */
    public function component()
    {
        $cate_id = 63;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        //所在位置
        $location = [
            [
            ],
            [
                'location' => '零部件展览',
                'url' => url('portal/exhibition/component')
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':cpage');
    }


    /**
     * 展会数据
     * portal/exhibition/data
     */
    public function data()
    {
        $cate_id = 10;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '展会数据',
                'url' => url('portal/exhibition/data')
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':page');
    }

    /**
     * 展厅分布
     * portal/exhibition/distribution
     */
    public function distribution()
    {
        $cate_id = 11;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '展厅分布',
                'url' => url('portal/exhibition/distribution')
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':page');
    }

    /**
     * 参展须知
     * portal/exhibition/notice
     */
    public function notice()
    {
        $cate_id = 12;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '参展须知',
                'url' => url('portal/exhibition/notice')
            ]
        ];
        $this->assign('info',$info);
        $this->assign('location',$location);
        return $this->fetch(':page');
    }

    /**
     * 历届回顾
     * portal/exhibition/review
     */
    public function review()
    {
        $cate_id = 13;
        $cateModel = new PortalCategoryModel();
        $list = $cateModel
            ->field('id,name,description,update_time,more')
            ->where('parent_id',$cate_id)
            ->paginate(6,false);

        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '历届回顾',
                'url' => url('portal/exhibition/review')
            ]
        ];
        //获取分页样式
        $page = $this->getPageStyle($list);
        $this->assign('list',$list);
        $this->assign('page',$page);
        $this->assign('location',$location);
        return $this->fetch();
    }

    /**
     * 历届回顾详情
     * portal/exhibition/review_detail
     */
    public function review_detail()
    {
        $cate_id = $this->request->param('cate_id','','intval');
        $two_cate_id = $this->request->param('two_cate_id','','intval');
        $cateModel = new PortalCategoryModel();
        $showModel = new ShowModel();
        $day_list = $cateModel
            ->field('id,name')
            ->where('parent_id',$cate_id)
            ->order('id DESC')
            ->select();
        if(empty($two_cate_id)){
            $two_cate_id = $day_list[0]['id'];
        }

        $list = $showModel->getList($two_cate_id,'',25);
        $page = $this->getPageStyle($list);
        //所在位置
        $location = [
            [
                'location' => '关于展会',
                'url' => 'javascript:;'
            ],
            [
                'location' => '回顾详情',
                'url' => 'javascript:;'
            ]
        ];
        $this->assign('location',$location);
        $this->assign('day_list',$day_list);
        $this->assign('cate_id',$cate_id);
        $this->assign('two_cate_id',$two_cate_id);
        $this->assign('page',$page);
        $this->assign('list',$list);
        return $this->fetch();
    }

    //移动端关于展会
    public function about(){
        $cate_id = 8;
        $pageModel = new PageModel();
        $info = $pageModel->where('cate_id',$cate_id)->find();
        $this->setPageNum($info['id']);
        $this->assign('info',$info);
        return $this->fetch();
    }

    //移动端导览活动
    public function activity(){
        return $this->fetch();
    }

    //移动端新闻报道ok
    public function newReport(){
        return $this->fetch();
    }

    //移动端论坛活动
    public function forumActivity(){
        return $this->fetch();
    }

    //移动端展商详情
    public function businessDetail(){
        return $this->fetch();
    }

    //移动端网上展厅
    public function onlineShow1(){
        return $this->fetch();
    }
    //移动端网上展厅
    public function onlineShow2(){
        return $this->fetch();
    }
    //移动端网上展厅
    public function onlineShow3(){
        return $this->fetch();
    }
    //移动端网上展厅
    public function onlineShow4(){
        return $this->fetch();
    }


    public function get_line(){
        $lineModel = new LineModel();
        $cate_id = $this->request->param('cate_id');
        $page = $this->request->param('page');
        $info = $lineModel
            ->where(['cate_id'=>$cate_id])
            ->page($page,1)
            ->select();
        foreach($info as &$value){
            $value['thumb'] = cmf_get_image_url($value['thumb']);
        }
        echo json_encode($info);
    }
}