ExamService.class.php
1.67 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* Created by PhpStorm.
* User: zhonglei
* Date: 2017/6/5
* Time: 14:33
*/
namespace Common\Service;
use Com\Rpc;
use Common\Common\Constant;
use Common\Model\ExamModel;
class ExamService extends AbstractService
{
// 构造方法
public function __construct()
{
parent::__construct();
$this->_d = new ExamModel();
}
/**
* @desc 根据题目ID获取题目列表
* @author tangxingguo
* @param array $etIds 题目ID
* @return array 题目列表
*/
public function listById($etIds)
{
if (!is_array($etIds)) {
return [];
}
$param_arr = [
'et_ids' => implode(',', $etIds),
];
$url = rpcUrl('/Exam/Rpc/Breakthrough/TopicList');
$res = Rpc::phprpc($url)->invoke('Index', $param_arr);
$res = json_decode($res, true);
$list = isset($res['list']) ? $res['list'] : [];
$etTypeList = Constant::EXAM_TYPE_LIST;
foreach ($list as $k => $v) {
$list[$k]['et_type'] = isset($etTypeList[$v['et_type']]) ? $etTypeList[$v['et_type']] : '';
}
return $list;
}
/**
* 根据条件获取测评人员列表
* @author liyifei
* @param array $conds 条件
* @param array $pages 分页
* @return array
*/
public function listUidByConds($conds, $pages)
{
return $this->_d->listUidByConds($conds, $pages);
}
/**
* 根据条件,获取测评人员总数
* @author liyifei
* @param array $conds 条件
* @return array
*/
public function countUidByConds($conds)
{
return $this->_d->countUidByConds($conds);
}
}