InfoController.class.php
1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* 获取试卷详情
* InfoController.class.php
* User: daijun
* Date: 2017年09月05日
*/
namespace Rpc\Controller\TaskCenter;
use Common\Service\PaperService;
class InfoController extends AbstractController
{
public function Index()
{
// 获取考试试卷ID
$params = $this->_params;
$app_data_ids = $params['app_data_ids'];
$paper_serv = new PaperService();
$conds = array(
'ep_id' => $app_data_ids,
'exam_type' => PaperService::TASK_TYPE,
'exam_status' => PaperService::PAPER_PUBLISH
);
// 查询试卷列表
$list = $paper_serv->list_by_conds($conds, null, [], 'ep_id,ep_name');
$result = [];
// 循环格式化返回数据
foreach ($list as $v) {
$arr = array(
'app_data_id' => intval($v['ep_id']),
'title' => $v['ep_name']
);
$result[] = $arr;
}
return $result;
}
}