|
@@ -352,15 +352,20 @@ class Topicdongtai extends Api
|
|
|
|
|
|
//系统消息
|
|
|
if($dt_user_id != $this->auth->id){
|
|
|
+
|
|
|
+ //以前的点赞都删除
|
|
|
+ $map = [
|
|
|
+ 'user_id' => $dt_user_id,
|
|
|
+ 'dt_id' => $id,
|
|
|
+ 'from_user_id' => $this->auth->id,
|
|
|
+ 'type' => 1, //类型:1=点赞,2=评论
|
|
|
+ ];
|
|
|
+ Db::name('topic_dongtai_message')->where($map)->delete();
|
|
|
+
|
|
|
//入库
|
|
|
- $data = [];
|
|
|
- $data['user_id'] = $dt_user_id;
|
|
|
- $data['dt_id'] = $id;
|
|
|
- $data['from_user_id'] = $this->auth->id;
|
|
|
- $data['title'] = '点赞了你的动态';
|
|
|
- $data['createtime'] = time();
|
|
|
-
|
|
|
- Db::name('topic_dongtai_message')->insertGetId($data);
|
|
|
+ $map['title'] = '点赞了你的动态';
|
|
|
+ $map['createtime'] = time();
|
|
|
+ Db::name('topic_dongtai_message')->insertGetId($map);
|
|
|
}
|
|
|
|
|
|
Db::commit();
|
|
@@ -457,9 +462,26 @@ class Topicdongtai extends Api
|
|
|
}
|
|
|
|
|
|
//系统消息
|
|
|
+ if($level == 1 && $dongtai_user_id != $this->auth->id ){
|
|
|
+
|
|
|
+ $map = [
|
|
|
+ 'user_id' => $dongtai_user_id,
|
|
|
+ 'dt_id' => $id,
|
|
|
+ 'from_user_id' => $this->auth->id,
|
|
|
+ 'answer_id' => $rs,
|
|
|
+ 'type' => 2, //类型:1=点赞,2=评论
|
|
|
+ ];
|
|
|
+
|
|
|
+ //入库
|
|
|
+ $map['title'] = '评论了你的动态';
|
|
|
+ $map['createtime'] = time();
|
|
|
+ Db::name('topic_dongtai_message')->insertGetId($map);
|
|
|
+ }
|
|
|
+
|
|
|
+ //系统消息
|
|
|
/*if($level == 1){
|
|
|
//发给动态用户
|
|
|
- $msg_user_id = Db::name('topic_dongtai')->where('id',$id)->value('user_id');
|
|
|
+ $msg_user_id = $dongtai_user_id;
|
|
|
$msg_title = '动态评论';
|
|
|
$msg_content = $this->auth->nickname.'评论了你的动态';
|
|
|
$infotype_id = $rs;
|
|
@@ -655,6 +677,16 @@ class Topicdongtai extends Api
|
|
|
|
|
|
if($info['level'] == 1){
|
|
|
|
|
|
+ //评论消息删除
|
|
|
+ $dongtai_user_id = Db::name('topic_dongtai')->where('id',$info['dt_id'])->value('user_id');
|
|
|
+ $map = [
|
|
|
+ 'user_id' => $dongtai_user_id,
|
|
|
+ 'dt_id' => $info['dt_id'],
|
|
|
+ 'from_user_id' => $this->auth->id,
|
|
|
+ 'answer_id' => $id,
|
|
|
+ 'type' => 2, //类型:1=点赞,2=评论
|
|
|
+ ];
|
|
|
+ Db::name('topic_dongtai_message')->where($map)->delete();
|
|
|
|
|
|
//楼层内都删
|
|
|
$louceng_id = Db::name('topic_dongtai_answer')->where('dt_id',$info['dt_id'])->where('level',2)->where('floor',$info['floor'])->column('id');
|
|
@@ -825,6 +857,9 @@ class Topicdongtai extends Api
|
|
|
$val['nickname'] = !empty($val['nickname_remark']) ? $val['nickname_remark'] : $val['nickname'];
|
|
|
}
|
|
|
|
|
|
+ //已读
|
|
|
+ Db::name('topic_dongtai_message')->where(['user_id'=>$this->auth->id,'status'=>0])->update(['status'=>1]);
|
|
|
+
|
|
|
$this->success('success',$list);
|
|
|
}
|
|
|
|