ReplyLikeController.class.php
1.14 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
<?php
/**
* ReplyLikeController.class.php
* 【同事圈-手机端】评论点赞
* User: heyuelong
* Date: 2017年4月27日15:03:32
*/
namespace Api\Controller\Like;
use Common\Common\DataCenter;
use Common\Service\LikeService;
use Common\Common\TaskCenter;
class ReplyLikeController extends \Api\Controller\AbstractController
{
/**
* 主方法
* @return boolean
*/
public function Index_get()
{
// 初始化点赞表
$service = new LikeService();
// 评论取消点赞
if (!$service->like(I('get.cid'), $this->uid)) {
return false;
}
// 常规任务埋点:评论点赞
$params = [
'uid' => $this->uid,
'app_data_id' => I('get.cid'),
'action_key' => 'workmate_like_comment',
'description' => '评论点赞'
];
$taskCenter = &TaskCenter::instance();
$taskCenter->triggerDailytask($params);
// 数据中心:评论点赞埋点
$datacenter =& DataCenter::instance();
$datacenter->addLike($this->_login->user, I('get.cid'));
$this->_result = [];
}
}