|
@@ -250,14 +250,14 @@ class Userfollow extends Api
|
|
|
|
|
|
$check = Db::name('user_follow')->where($map2)->find();
|
|
|
if(empty($check) && $this->user_power($this->auth->id,'yinsi') != 1){
|
|
|
- //防止重复刷关注,如果总是重复关注,取关,一天内就发一次消息
|
|
|
- $check = Db::name('message')
|
|
|
+ //防止重复刷关注,先删掉以前的,再加新的
|
|
|
+ Db::name('message')
|
|
|
->where('user_id',$follow_uid)
|
|
|
->where('infotype','newfriend')
|
|
|
->where('infotype_id',$this->auth->id)
|
|
|
- ->where('createtime','gt',strtotime(date('Y-m-d')))
|
|
|
- ->find();
|
|
|
- if(!$check){
|
|
|
+ ->where('status',0)
|
|
|
+ ->delete();
|
|
|
+
|
|
|
$message = [
|
|
|
'user_id' => $follow_uid,
|
|
|
'title' => '好友请求',
|
|
@@ -268,7 +268,7 @@ class Userfollow extends Api
|
|
|
'infotype_id' => $this->auth->id,
|
|
|
];
|
|
|
Db::name('message')->insertGetId($message);
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//我从好友审核列表过来的,我又回关了
|