CourseInfoScanController.class.php 894 Bytes
<?php
/**
 * Created by PhpStorm.
 * User: wanghuan
 * Date: 2017/12/22
 * Time: 17:25
 */

namespace Frontend\Controller\Index;

use Common\Common\Constant;

class CourseInfoScanController extends AbstractController
{

    // 免登录
    protected $_require_login = false;

    public function Index()
    {

        $article_id = I('get.article_id', '', 'trim');
        $article_type = I('get.article_type', '', 'trim');

        if (empty($article_id)) {

            E('_ERR_COURSE_ID_EMPTY');
        }

        // 单课程
        $pageUrl = '/app/page/course/detail/detail';
        // 系列课程
        if (Constant::ARTICLE_TYPE_MULTI == $article_type) {

            $pageUrl = '/app/page/course/detail/course-detail';
        }

        // 跳转地址
        redirectFront($pageUrl, ['article_id' => $article_id, 'is_preview' => Constant::COURSE_INFO_PREVIEW_TRUE]);
    }
}