作者 邓超

x

... ... @@ -645,6 +645,15 @@ class Home extends Base {
if($reload){
// 删除原有数据
db()->delete(bodySql::$table,['lists_id'=>$id]);
//同步基础信息
$mail = new Mail($email['email'],base64_decode($email['password']),$email['imap']);
if($mail->login()){
$folder = db()->value(folderSql::first(['id'=>$data['folder_id']],'origin_folder'));
if($folder){
$mail->client->selectFolder($folder);
$mail->syncUidEmail([$data['uid']],$email['id'],$folder,$data['folder_id'],[],[],db());
}
}
}
HOME_INFO_BODY:
... ...
... ... @@ -273,7 +273,7 @@ class Mail {
* @param $folder_id
* @param $blacklist
* @param $blackFolder
* @param $db
* @param \Lib\DbPool $db
* @throws \Exception
* @author:dc
* @time 2023/8/2 15:35
... ... @@ -374,6 +374,14 @@ class Mail {
// 插入数据库
try {
$id = $db->insert(listsSql::$table,$data);
// 插入失败,尝试更新
if(!$id){
$db->update(listsSql::$table,$data,dbWhere([
'email_id'=> $data['email_id'],
'folder_id' => $data['folder_id'],
'uid' => $data['uid']
]));
}
if($id){
// 同步body内容
redis()->rPush('sync_email_body', [
... ...