作者 邓超

xxx

@@ -114,30 +114,30 @@ class Mail { @@ -114,30 +114,30 @@ class Mail {
114 $folder['parseFolder'] = explode('/',$folder['parseFolder'])[1]; 114 $folder['parseFolder'] = explode('/',$folder['parseFolder'])[1];
115 } 115 }
116 116
117 - if(!$db->count(folderSql::has(['uuid'=>$uuid]))){  
118 - try {  
119 - $folder_name = '';  
120 - // 已发送  
121 - if(in_array('Send',$folder['check'])){  
122 - $folder_name = folderAlias('Send');  
123 - }  
124 - // 草稿  
125 - elseif(in_array('Drafts',$folder['check'])){  
126 - $folder_name = folderAlias('Drafts');  
127 - }  
128 - // 垃圾  
129 - elseif(in_array('Junk',$folder['check'])){  
130 - $folder_name = folderAlias('Junk');  
131 - }  
132 - // 回收站  
133 - elseif(in_array('Trash',$folder['check'])){  
134 - $folder_name = folderAlias('Trash');  
135 - }  
136 117
137 - if(!$folder_name){  
138 - $folder_name = folderAlias($folder['parseFolder']);  
139 - } 118 + try {
  119 + $folder_name = '';
  120 + // 已发送
  121 + if(in_array('Send',$folder['check'])){
  122 + $folder_name = folderAlias('Send');
  123 + }
  124 + // 草稿
  125 + elseif(in_array('Drafts',$folder['check'])){
  126 + $folder_name = folderAlias('Drafts');
  127 + }
  128 + // 垃圾
  129 + elseif(in_array('Junk',$folder['check'])){
  130 + $folder_name = folderAlias('Junk');
  131 + }
  132 + // 回收站
  133 + elseif(in_array('Trash',$folder['check'])){
  134 + $folder_name = folderAlias('Trash');
  135 + }
140 136
  137 + if(!$folder_name){
  138 + $folder_name = folderAlias($folder['parseFolder']);
  139 + }
  140 + if(!$db->count(folderSql::has(['uuid'=>$uuid]))){
141 $db->insert(folderSql::$table,[ 141 $db->insert(folderSql::$table,[
142 'email_id' => $email_id, 142 'email_id' => $email_id,
143 'folder' => folderAlias($folder_name), 143 'folder' => folderAlias($folder_name),
@@ -145,12 +145,21 @@ class Mail { @@ -145,12 +145,21 @@ class Mail {
145 'uuid' => $uuid, 145 'uuid' => $uuid,
146 'pid' => $pid 146 'pid' => $pid
147 ],false); 147 ],false);
148 - }catch (\Throwable $e){  
149 - // 这里就不处理失败了 148 + }else{
  149 + $db->update(folderSql::$table,[
  150 + 'email_id' => $email_id,
  151 + 'folder' => folderAlias($folder_name),
  152 + 'origin_folder' => $folder['folder'],
  153 + 'uuid' => $uuid,
  154 + 'pid' => $pid
  155 + ],dbWhere(['email_id' => $email_id,'uuid' => $uuid]),false);
150 } 156 }
  157 + }catch (\Throwable $e){
  158 + // 这里就不处理失败了
151 } 159 }
152 160
153 161
  162 +
154 } 163 }
155 // $db->commit(); 164 // $db->commit();
156 165