StartBreakController.class.php
883 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
<?php
/**
* 【考试中心-手机端】开始闯关接口
* StartBreakController.class.php
* @author: 蔡建华
* @date: 2017-05-23
*/
namespace Api\Controller\Breakthrough;
use Common\Service\TopicService;
class StartBreakController extends AbstractController
{
public function Index_post()
{
// 接收post参数
$params = I('post.');
// 实例化闯关答卷service
$break_serv = new TopicService();
// 课程id
$ec_id = intval($params['ec_id']);
// 试题id,多个逗号分隔
$et_ids = $params['et_ids'];
// 开始闯关数据保存
$res = $break_serv->start_break($ec_id, $et_ids);
// 操作失败,返回false
if (!$res) {
return false;
}
// 返回结果
$this->_result = ['list' => $res];
return true;
}
}