...
|
...
|
@@ -54,7 +54,7 @@ class Mail { |
|
|
// 读取所有文件夹,未解密
|
|
|
$folders = $this->client->getFolder();
|
|
|
|
|
|
$db->transaction();
|
|
|
// $db->transaction();
|
|
|
foreach ($folders as $folder){
|
|
|
// 处理子父文件夹
|
|
|
$folder['id'] = explode('/',$folder['folder']);
|
...
|
...
|
@@ -78,7 +78,7 @@ class Mail { |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$db->commit();
|
|
|
// $db->commit();
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -95,6 +95,7 @@ class Mail { |
|
|
* @time 2023/2/18 9:54
|
|
|
*/
|
|
|
public function syncMail($email_id,$folder_id,$folder='INBOX',$db = null):bool {
|
|
|
// _echo('正在同步文件夹:'.$folder);
|
|
|
$db = $db ? $db : db();
|
|
|
// 选择文件夹
|
|
|
$status = $this->client->selectFolder($folder);
|
...
|
...
|
@@ -196,7 +197,7 @@ class Mail { |
|
|
$uuids = $db->all(listsSql::hasUuid(array_column($results,'uuid')));
|
|
|
$uuids = $uuids ? array_column($uuids,null,'uuid') : [];
|
|
|
|
|
|
$db->transaction();
|
|
|
// $db->transaction();
|
|
|
foreach ($results as $insert){
|
|
|
if(empty($uuids[$insert['uuid']])){
|
|
|
// 新增
|
...
|
...
|
@@ -210,7 +211,7 @@ class Mail { |
|
|
);
|
|
|
}
|
|
|
}
|
|
|
$db->commit();
|
|
|
// $db->commit();
|
|
|
|
|
|
// 更新数量
|
|
|
$db->update(
|
...
|
...
|
|