|
@@ -105,6 +105,20 @@ class SyncMail { |
|
@@ -105,6 +105,20 @@ class SyncMail { |
105
|
return $this;
|
105
|
return $this;
|
106
|
}
|
106
|
}
|
107
|
|
107
|
|
|
|
108
|
+ // 查找uid之后的数据
|
|
|
109
|
+ public $isUid = 0;
|
|
|
110
|
+
|
|
|
111
|
+ /**
|
|
|
112
|
+ * @param $uid 2 表示没有数据 则执行下一个条件 1表示没有数据就没有数据
|
|
|
113
|
+ * @return $this
|
|
|
114
|
+ * @author:dc
|
|
|
115
|
+ * @time 2025/3/7 14:53
|
|
|
116
|
+ */
|
|
|
117
|
+ public function isUidAfter($uid=1){
|
|
|
118
|
+ $this->isUid = $uid;
|
|
|
119
|
+ return $this;
|
|
|
120
|
+ }
|
|
|
121
|
+
|
108
|
|
122
|
|
109
|
protected function emailId(){
|
123
|
protected function emailId(){
|
110
|
return $this->email['id'];
|
124
|
return $this->email['id'];
|
|
@@ -334,6 +348,25 @@ class SyncMail { |
|
@@ -334,6 +348,25 @@ class SyncMail { |
334
|
$p=1;
|
348
|
$p=1;
|
335
|
while (1){
|
349
|
while (1){
|
336
|
if($this->isStop) return $sync_number;
|
350
|
if($this->isStop) return $sync_number;
|
|
|
351
|
+
|
|
|
352
|
+ if($this->isUid){
|
|
|
353
|
+ $maxUid = $this->db->value(listsSql::first(dbWhere([
|
|
|
354
|
+ 'email_id'=>$this->emailId(),
|
|
|
355
|
+ 'folder_id'=>$folder_id,
|
|
|
356
|
+ ]),'max(uid)'));
|
|
|
357
|
+ $maxUid = $maxUid?$maxUid:0;
|
|
|
358
|
+ if($this->isUid==1&&!$maxUid){
|
|
|
359
|
+ return 0;
|
|
|
360
|
+ }
|
|
|
361
|
+ if($maxUid){
|
|
|
362
|
+ $lists = $msg->uid(1)->get($maxUid.':*')->all();
|
|
|
363
|
+ if($lists){
|
|
|
364
|
+ $this->saveMail($folder_id,$lists,$isBody);
|
|
|
365
|
+ return count($lists);
|
|
|
366
|
+ }
|
|
|
367
|
+ }
|
|
|
368
|
+ }
|
|
|
369
|
+
|
337
|
// 是否搜索
|
370
|
// 是否搜索
|
338
|
if ($this->search instanceof ImapSearch){
|
371
|
if ($this->search instanceof ImapSearch){
|
339
|
$uids = $msg->search($this->search)->getUids();
|
372
|
$uids = $msg->search($this->search)->getUids();
|