作者 邓超

1

... ... @@ -43,13 +43,29 @@ class Folder extends Base {
);
$data = [];
foreach ($folders as $k=>$folder){
if (empty($data[$emails[$folder['email_id']]])){
$data[$emails[$folder['email_id']]] = [];
foreach ($emails as $eid=>$email){
if (empty($data[$email])){
$data[$email] = [];
}
foreach ($folders as $k=>$folder){
if($folder['email_id'] == $eid){
unset($folder['email_id']);
$data[$email][$k] = $folder;
}
}
// 没有存在数据
if(!$data[$email]){
$data[$email][] = [
'folder' => folderAlias('INBOX'),
'id' => 0,
'exsts' => 0,
'unseen' => 0,
'pid' => 0
];
}
$data[$emails[$folder['email_id']]][$k] = $folder;
unset($data[$emails[$folder['email_id']]][$k]['email_id']);
}
$folders = $data;$data = null;
foreach ($folders as $f=>$folder){
... ...