正在显示
1 个修改的文件
包含
6 行增加
和
2 行删除
@@ -69,12 +69,16 @@ class HotMail { | @@ -69,12 +69,16 @@ class HotMail { | ||
69 | 69 | ||
70 | // 黑名单 | 70 | // 黑名单 |
71 | if(!empty($this->back)&&is_array($this->back)){ | 71 | if(!empty($this->back)&&is_array($this->back)){ |
72 | + $version = time(); | ||
72 | foreach ($this->back as $item){ | 73 | foreach ($this->back as $item){ |
73 | - if(!$this->db->count("select count(*) from `ai_black_email` where ".dbWhere(['email'=>$item]))){ | 74 | + if(!$id = $this->db->value("select `id` from `ai_black_email` where ".dbWhere(['email'=>$item]))){ |
74 | echo '插入数据 '.$item."\n"; | 75 | echo '插入数据 '.$item."\n"; |
75 | - $this->db->insert('ai_black_email',['email'=>$item],false); | 76 | + $this->db->insert('ai_black_email',['email'=>$item,'time'=>$version],false); |
77 | + }else{ | ||
78 | + $this->db->update('ai_black_email',['time'=>$version],'`id` = '.$id,false); | ||
76 | } | 79 | } |
77 | } | 80 | } |
81 | + $this->db->delete('ai_black_email',['time.<>'=>$version]); | ||
78 | } | 82 | } |
79 | 83 | ||
80 | } | 84 | } |
-
请 注册 或 登录 后发表评论