MoveController.class.php
855 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
<?php
/**
* 【考试中心-后台】批量移动试题到指定题库
* MoveController.class.php
* @author: pw
* @email: 254995618@qq.com
* @date : 2018-05-16 16:15:33
* @version $Id$
*/
namespace Apicp\Controller\Topic;
class MoveController extends AbstractController
{
public function Index_post()
{
// 所选题目ids
$etIds = I('post.et_ids');
// 目标题库id
$ebId = I('post.eb_id');
if (!$etIds || empty($etIds)) {
E('_EMPTY_ET_ID');
}
if (!$ebId || 0 == $ebId) {
E('_EMPTY_EB_ID');
}
// 去重去空
$etIds = array_unique(array_filter($etIds));
// 修改题目所属题库
if (!$this->topic_service->move_topic($etIds, (int)$ebId)) {
return false;
}
return true;
}
}