作者 邓超

预热邮件

... ... @@ -938,6 +938,9 @@ class Home extends Base {
// 没有,说明没有同步过来
$email = $this->getEmail('*',false);
$data = db()->first(listsSql::first(dbWhere(['id'=>$id,'email_id'=>$email['id']])));
if(!$data){
$data = db()->first(listsSql::firstHot(dbWhere(['id'=>$id,'email_id'=>$email['id']])));
}
}
if($data){
... ...
... ... @@ -75,6 +75,11 @@ class listsSql {
return "select {$filed} from `".self::$table."` where ".$where.' limit 1';
}
public static function firstHot(string $where,$filed='*'):string {
return "select {$filed} from `lists_hot` where ".$where.' limit 1';
}
/**
* 查询所有
* @param $where
... ...
... ... @@ -420,6 +420,13 @@ class SyncMail {
'folder_id' => $data['folder_id'],
'uid' => $data['uid']
]),'`id`'));
if(!$id){
$id = $this->db->value(listsSql::firstHot(dbWhere([
'email_id'=> $data['email_id'],
'folder_id' => $data['folder_id'],
'uid' => $data['uid']
]),'`id`'));
}
if(!$id){
... ... @@ -437,7 +444,9 @@ class SyncMail {
Event::call('mail_sync_list',$id, $data);
}else{
$this->db->update(listsSql::$table,$data,dbWhere(['id'=> $id]));
if(!$this->db->update(listsSql::$table,$data,dbWhere(['id'=> $id]))){
$this->db->update('lists_hot',$data,dbWhere(['id'=> $id]));
}
}
//TODO 如果header 头信息里面有2段数据 第二段就作为内容解析
... ...