MsgController.class.php
1.16 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
<?php
/**
*
* @author: houyingcai
* @email: 594609175@qq.com
* @date : 2017-05-10 17:22:44
* @version $Id$
*/
namespace Frontend\Controller\Index;
use Common\Service\CommentService;
class MsgController extends \Common\Controller\Frontend\AbstractController
{
// 消息ID类型为活动
const ACTIVITY = 1;
// 消息ID类型为回复
const REPLY = 2;
/**
* 不是必须登录
* @var string $_require_login
*/
protected $_require_login = false;
public function Index()
{
$params = I('get.');
// 跳转活动详情
if ($params['type'] == self::ACTIVITY) {
redirectFront('/app/page/activity/activity-detail',
array('_identifier' => APP_IDENTIFIER, 'ac_id' => $params['id']));
}
// 跳转评论详情
if ($params['type'] == self::REPLY) {
$comm_serv = new CommentService();
$comm_data = $comm_serv->get($params['id']);
redirectFront('/app/page/activity/activity-reply',
array('_identifier' => APP_IDENTIFIER, 'comment_id' => $params['id'], 'ac_id' => $comm_data['ac_id']));
}
}
}