FetchExamController.class.php 843 Bytes
<?php
/**
 * 查询试卷信息
 * ListController.class.php
 * User: daijun
 * Date: 2017年09月05日
 */

namespace Rpc\Controller\Train;

use Common\Service\PaperService;

class FetchExamController extends AbstractController
{

    public function Index()
    {
        // 获取参数
        $params = $this->_params;
        $ep_ids = $params['ep_ids'];
        // 实例化service
        $service = new PaperService();

        // 查询条件
        $conds = array(
            'ep_id' => $ep_ids
        );

        $field = 'ep_id,paper_type,ep_name';

        // 排序参数
        $order_option = array('ep_id' => 'DESC');

        $list = [];

        if (!empty($ep_ids)) {
            // 查询列表
            $list = $service->list_by_conds($conds, null, $order_option, $field);
        }

        return $list;
    }
}