作者 邓超

x

@@ -31,15 +31,19 @@ class MailListV2 extends Base { @@ -31,15 +31,19 @@ class MailListV2 extends Base {
31 * @time 2024/7/19 11:37 31 * @time 2024/7/19 11:37
32 */ 32 */
33 private function getFolderId(string $folder,$emails=[]){ 33 private function getFolderId(string $folder,$emails=[]){
  34 + if(!$emails){
  35 + $emails = $this->getEmails('id');
  36 + }
  37 + $k = md5(json_encode($emails));
34 // 查询 文件夹 38 // 查询 文件夹
35 static $folderList; 39 static $folderList;
36 - if(!$folderList){  
37 - $folderList = db()->all(folderSql::all($emails?:$this->getEmails('id'))); 40 + if(empty($folderList[$k])){
  41 + $folderList[$k] = db()->all(folderSql::all($emails));
38 } 42 }
39 $folder_id = []; 43 $folder_id = [];
40 // 文件夹id 44 // 文件夹id
41 - if($folderList){  
42 - foreach ($folderList as $item){ 45 + if($folderList[$k]){
  46 + foreach ($folderList[$k] as $item){
43 if(folderAlias($item['folder']) == $folder){ 47 if(folderAlias($item['folder']) == $folder){
44 $folder_id[] = $item['id']; 48 $folder_id[] = $item['id'];
45 } 49 }