...
|
...
|
@@ -409,6 +409,8 @@ class Topic extends Api |
|
|
if(empty($good)){
|
|
|
TopicGood::create($where);
|
|
|
$this->success('点赞成功');
|
|
|
// 增加话题热力值(点赞+1热力值)
|
|
|
$info->setInc('hot_num');
|
|
|
}
|
|
|
$good->delete();
|
|
|
$this->success('取消点赞');
|
...
|
...
|
@@ -603,6 +605,8 @@ class Topic extends Api |
|
|
$content = $this->request->param('content');
|
|
|
empty($topic_id) && $this->error('缺少必需参数');
|
|
|
empty($content) && $this->error('请填写评论内容');
|
|
|
$topic = $this->model->get($topic_id);
|
|
|
empty($topic) && $this->error('话题信息不存在');
|
|
|
$pid = 0;
|
|
|
if(!empty($cue_appraise_id)){
|
|
|
$info = TopicAppraise::get($cue_appraise_id);
|
...
|
...
|
@@ -616,6 +620,10 @@ class Topic extends Api |
|
|
'cue_appraise_id' => $cue_appraise_id,
|
|
|
'content' => $content
|
|
|
]);
|
|
|
if($topic['user_id'] != $this->auth->id){
|
|
|
// 增加话题热力值(评论回复(本人除外)+5热力值)
|
|
|
$topic->setInc('hot_num',5);
|
|
|
}
|
|
|
$this->success('评论成功');
|
|
|
}
|
|
|
|
...
|
...
|
|