DelController.class.php
1.23 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
<?php
/**
* 【业绩比拼-手机端】删除我的回帖或回复接口
*
* User: daijun
* Date: 2017-11-02
*/
namespace Api\Controller\Common;
use Common\Service\CommentService;
use Common\Service\ReplyService;
class DelController extends \Api\Controller\AbstractController
{
public function Index_post()
{
// 获取参数
$obj_id = I('post.obj_id', 0, 'intval');
$type = I('post.type', 0, 'intval');
// 判断是否外部人员
if (empty($this->uid)) {
E('_EMPTY_USER_ID');
}
if (empty($obj_id)) {
// 验证数据ID
E('_EMPTY_DEL_ID');
}
if (empty($type)) {
// 验证数据类型
E('_EMPTY_DEL_TYPE');
}
if (CommentService::DEL_COMMENT_TYPE == $type) {
// 回帖信息表
$comment_serv = new CommentService();
// 删除回帖
$comment_serv->del_comment($obj_id, $this->uid);
} elseif (ReplyService::DEL_REPLY_TYPE == $type) {
// 回复信息表
$reply_serv = new ReplyService();
// 删除回复
$reply_serv->del_reply($obj_id, $this->uid);
}
return true;
}
}