MsgController.class.php
3.1 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/**
*
* @author: houyingcai
* @email: 594609175@qq.com
* @date : 2017-05-10 17:22:44
* @version $Id$
*/
namespace Frontend\Controller\Index;
use Common\Service\ActivityService;
use Common\Service\CommentService;
use Common\Service\PacketrecordService;
class MsgController extends \Common\Controller\Frontend\AbstractController
{
public function Index()
{
$params = I('get.');
// 跳转活动详情
if ($params['type'] == ActivityService::MSG_TYPE_ACTIVITY) {
redirectFront('/app/page/activitykb/activitykb-sale-detail',
['_identifier' => APP_IDENTIFIER, 'ac_id' => $params['ac_id']]);
}
// 跳转审核人审核评论的详情
if ($params['type'] == ActivityService::MSG_CHECK_TYPE_ACTIVITY) {
redirectFront('/app/page/activitykb/activitykb-mobile-check',
[
'_identifier' => APP_IDENTIFIER,
'comment_id' => $params['comment_id'],
'ac_id' => $params['ac_id']
]
);
}
// 跳转评论详情
if ($params['type'] == ActivityService::MSG_TYPE_COMMENT) {
$comm_serv = new CommentService();
$comm_data = $comm_serv->get($params['comment_id']);
if (!empty($comm_data)) {
$ac_id = $comm_data['ac_id'];
} else {
$ac_id = $params['ac_id'];
}
if (CommentService::CHECK_OK == $comm_data['check_status']) {
// 审核通过
redirectFront('/app/page/activitykb/activitykb-reply',
[
'_identifier' => APP_IDENTIFIER,
'comment_id' => $params['comment_id'],
'ac_id' => $ac_id
]);
} else {
// 驳回或者待审核
redirectFront('/app/page/activitykb/activitykb-check-comment',
[
'_identifier' => APP_IDENTIFIER,
'comment_id' => $params['comment_id'],
'ac_id' => $ac_id
]);
}
}
// 跳转红包详情
if ($params['type'] == ActivityService::MSG_TYPE_REDPACKET) {
$record_service = new PacketrecordService();
// 查询红包记录表
$record = $record_service->get($params['rid']);
if (empty($params['ac_id'])) {
$ac_id = $record['ac_id'];
} else {
$ac_id = $params['ac_id'];
}
if ($record['packet_status'] == PacketrecordService::PACKET_STATUS_WAIT) {
// 待领取
redirectFront('/app/page/redlucky/red-lucky',
['_identifier' => APP_IDENTIFIER, 'rid' => $params['rid'], 'ac_id' => $ac_id]);
} else {
// 领取成功和领取失败
redirectFront('/app/page/redlucky/get-lucky',
['_identifier' => APP_IDENTIFIER, 'rid' => $params['rid']]);
}
}
}
}