|
@@ -369,6 +369,7 @@ class Topicdongtai extends Api
|
|
|
'user_id' => $this->auth->id,
|
|
|
];
|
|
|
$check = Db::name('topic_dongtai_good')->where($where)->find();
|
|
|
+ $dt_user_id = Db::name('topic_dongtai')->where('id',$id)->value('user_id');
|
|
|
|
|
|
if($check){
|
|
|
Db::name('topic_dongtai_good')->where($where)->delete();
|
|
@@ -390,6 +391,8 @@ class Topicdongtai extends Api
|
|
|
$this->error('点赞失败');
|
|
|
}
|
|
|
|
|
|
+ //系统消息
|
|
|
+ $msg_id = \app\common\model\Message::addMessage($dt_user_id,'动态点赞','有人赞了你的动态','dongtai_good',$id);
|
|
|
|
|
|
Db::commit();
|
|
|
$this->success('点赞成功');
|
|
@@ -452,6 +455,23 @@ class Topicdongtai extends Api
|
|
|
|
|
|
Db::name('topic_dongtai')->where('id',$id)->setInc('answernum');
|
|
|
|
|
|
+ //系统消息
|
|
|
+ if($level == 1){
|
|
|
+ //发给动态用户
|
|
|
+ $msg_user_id = Db::name('topic_dongtai')->where('id',$id)->value('user_id');
|
|
|
+ $msg_title = '动态评论';
|
|
|
+ $msg_content = '有人评论了你的动态';
|
|
|
+ $infotype_id = $rs;
|
|
|
+ }else{
|
|
|
+ //发给层主
|
|
|
+ $answer_info = Db::name('topic_dongtai_answer')->where(['dt_id'=>$id,'level'=>1,'floor'=>$floor])->find();
|
|
|
+ $msg_user_id = $answer_info['user_id'];
|
|
|
+ $msg_title = '动态评论点评';
|
|
|
+ $msg_content = '有人点评了你的动态评论';
|
|
|
+ $infotype_id = $answer_info['id'];
|
|
|
+ }
|
|
|
+ $msg_id = \app\common\model\Message::addMessage($msg_user_id,$msg_title,$msg_content,'dongtai_answer',$infotype_id);
|
|
|
+
|
|
|
Db::commit();
|
|
|
$this->success('评价成功');
|
|
|
}
|