作者 邓超

x

@@ -19,7 +19,7 @@ class Test { @@ -19,7 +19,7 @@ class Test {
19 19
20 public function a(){ 20 public function a(){
21 21
22 -return 404; 22 +// return 404;
23 23
24 // $urlGetSign = function ($mobile){ 24 // $urlGetSign = function ($mobile){
25 // $time = time(); 25 // $time = time();
@@ -83,34 +83,44 @@ return 404; @@ -83,34 +83,44 @@ return 404;
83 if($login->isOk()) { 83 if($login->isOk()) {
84 $uid = (int) app()->request('uid'); 84 $uid = (int) app()->request('uid');
85 $page = (int) app()->request('page',1); 85 $page = (int) app()->request('page',1);
  86 + $f = app()->request('f','INBOX');
  87 +
86 // foreach ($imap->getFolders()->all() as $a){ 88 // foreach ($imap->getFolders()->all() as $a){
87 // echo $a->folder; 89 // echo $a->folder;
88 // echo '=>'; 90 // echo '=>';
89 // echo $a->getParseFolder(); 91 // echo $a->getParseFolder();
90 // echo '|'; 92 // echo '|';
91 // }; 93 // };
92 - $folder = $imap->folder('INBOX'); 94 + $folder = $imap->folder($f=='INBOX'?$f:base64_decode($f));
93 95
94 if($uid){ 96 if($uid){
95 $msg = $folder->msg()->uid([$uid])->get()->first(); 97 $msg = $folder->msg()->uid([$uid])->get()->first();
96 98
97 return $msg->body->getHtml(); 99 return $msg->body->getHtml();
98 } 100 }
  101 + echo "<div style='display: flex'><div style='width: 200px;'>";
  102 +
  103 + foreach ($imap->getFolders()->all() as $fl){
  104 + echo "<p><a href=\"?mid={$email['id']}&f=".base64_encode($fl->folder)."\">".($fl->getParseFolder())."</a></p>";
  105 + }
99 106
  107 + echo "</div><div>";
100 108
101 echo '总共有:'; 109 echo '总共有:';
102 echo $folder->getTotal(); 110 echo $folder->getTotal();
103 echo "<br>"; 111 echo "<br>";
104 echo "<br>"; 112 echo "<br>";
105 - echo '<a href="?mid='.$email['id'].'&page='.($page+1).'">下一页</a>'; 113 + echo '<a href="?mid='.$email['id'].'&page='.($page-1).'&f='.$f.'">上一页</a>';
  114 + echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
  115 + echo '<a href="?mid='.$email['id'].'&page='.($page+1).'&f='.$f.'">下一页</a>';
106 echo "<br>"; 116 echo "<br>";
107 echo "<hr>"; 117 echo "<hr>";
108 118
109 119
110 $msgs = $folder->msg()->forPage($page)->get(); 120 $msgs = $folder->msg()->forPage($page)->get();
111 if ($msgs) { 121 if ($msgs) {
112 - $msgs->each(function ($msg) use($email){  
113 - echo '<p><a href="?mid='.$email['id'].'&uid='.$msg->uid.'">'.$msg->uid.'==>'.$msg->header->getSubject().' =====> '.date('Y-m-d H:i:s',strtotime($msg->date)).'</a></p>'; 122 + $msgs->each(function ($msg) use($email,$f){
  123 + echo '<p><a href="?mid='.$email['id'].'&uid='.$msg->uid.'&f='.$f.'">'.$msg->uid.'==>'.$msg->header->getSubject().' =====> '.date('Y-m-d H:i:s',strtotime($msg->date)).'</a></p>';
114 }); 124 });
115 // echo $msg->header->getSubject(); 125 // echo $msg->header->getSubject();
116 // echo '<br>-------------------------------------------------<br>'; 126 // echo '<br>-------------------------------------------------<br>';
@@ -132,6 +142,7 @@ return 404; @@ -132,6 +142,7 @@ return 404;
132 echo $login->getMessage(); 142 echo $login->getMessage();
133 } 143 }
134 144
  145 + echo "</div></div>";
135 } 146 }
136 147
137 148
@@ -134,6 +134,10 @@ class MailListV2Es2 extends Base { @@ -134,6 +134,10 @@ class MailListV2Es2 extends Base {
134 $where['source'] = 2; // ai邮件群体 134 $where['source'] = 2; // ai邮件群体
135 if(count($this->getEmails('id')) == 1) $where['email_id'] = $this->getEmails('id'); 135 if(count($this->getEmails('id')) == 1) $where['email_id'] = $this->getEmails('id');
136 136
  137 + if($ids){
  138 + unset($where['is_hots'],$where['is_auto']);
  139 + }
  140 +
137 $query = [ 141 $query = [
138 'bool'=>[ 142 'bool'=>[
139 'must' => [] 143 'must' => []