ExtractController.class.php 916 Bytes
<?php
/**
 * 【考试中心-后台】 试卷备选题目重新抽取接口
 * ExtractController.class.php
 * User: daijun
 * Date: 2017-05-23
 */

namespace Apicp\Controller\Paper;

use Common\Service\PaperService;

class ExtractController extends AbstractController
{
    /** @var PaperService 试卷信息表 */
    protected $paper_service;

    public function before_action($action = '')
    {

        if (!parent::before_action($action)) {
            return false;
        }
        // 实例化试卷信息表
        $this->paper_service = new PaperService();

        return true;
    }

    public function Index_post()
    {
        $ep_id = I('post.ep_id', 0, 'intval');

        // 验证参数
        if (empty($ep_id)) {

            E('_EMPTY_PAPER_ID');

        }

        if (!$this->paper_service->extract_topic($ep_id)) {

            return false;
        }

        return true;

    }

}