作者 邓超

优化同步

@@ -39,7 +39,9 @@ class Home extends Base { @@ -39,7 +39,9 @@ class Home extends Base {
39 $id = app()->request('id'); 39 $id = app()->request('id');
40 if($id && is_numeric($id)){ 40 if($id && is_numeric($id)){
41 ob_start(); 41 ob_start();
42 - $num = (new SyncMail($id))->search((new ImapSearch())->date(date('Y-m-d')))->sync(); 42 + $num = (new SyncMail($id))->isUidAfter(2)
  43 + ->search((new ImapSearch())
  44 + ->dateGt(date('Y-m-d')))->sync();
43 ob_clean(); 45 ob_clean();
44 if(is_array($num)){ 46 if(is_array($num)){
45 app()->_json($num); 47 app()->_json($num);