作者 邓超

hot

... ... @@ -69,12 +69,16 @@ class HotMail {
// 黑名单
if(!empty($this->back)&&is_array($this->back)){
$version = time();
foreach ($this->back as $item){
if(!$this->db->count("select count(*) from `ai_black_email` where ".dbWhere(['email'=>$item]))){
if(!$id = $this->db->value("select `id` from `ai_black_email` where ".dbWhere(['email'=>$item]))){
echo '插入数据 '.$item."\n";
$this->db->insert('ai_black_email',['email'=>$item],false);
$this->db->insert('ai_black_email',['email'=>$item,'time'=>$version],false);
}else{
$this->db->update('ai_black_email',['time'=>$version],'`id` = '.$id,false);
}
}
$this->db->delete('ai_black_email',['time.<>'=>$version]);
}
}
... ...