|
@@ -245,15 +245,27 @@ class SyncMail { |
|
@@ -245,15 +245,27 @@ class SyncMail { |
245
|
$p=1;
|
245
|
$p=1;
|
246
|
while (1){
|
246
|
while (1){
|
247
|
if($this->isStop) return;
|
247
|
if($this->isStop) return;
|
|
|
248
|
+ $uids = $msg->forPage($p)->getUids();
|
|
|
249
|
+ if($uids){
|
|
|
250
|
+ $p++;
|
248
|
|
251
|
|
249
|
- $lists = $msg->forPage($p)->get()->all();
|
252
|
+ foreach ($uids as $k=>$uid){
|
|
|
253
|
+ if($this->db->cache(86400*30,false)->value(listsSql::first(dbWhere(['email_id'=>$this->emailId(),'folder_id'=>$folder_id,'uid'=>$uid]),'count(*) as c'))){
|
|
|
254
|
+ unset($uids[$k]);
|
|
|
255
|
+ }
|
|
|
256
|
+ }
|
|
|
257
|
+
|
|
|
258
|
+ if(!$uids) continue;
|
|
|
259
|
+
|
|
|
260
|
+ $lists = $msg->uid($uids)->get()->all();
|
250
|
// 没有数据就跳出
|
261
|
// 没有数据就跳出
|
251
|
- if(!$lists){
|
|
|
252
|
- break;
|
|
|
253
|
- }else{
|
|
|
254
|
- $p++;
|
262
|
+ if($lists){
|
255
|
$this->saveMail($folder_id,$lists,$isBody);
|
263
|
$this->saveMail($folder_id,$lists,$isBody);
|
256
|
}
|
264
|
}
|
|
|
265
|
+ }else{
|
|
|
266
|
+ break;
|
|
|
267
|
+ }
|
|
|
268
|
+
|
257
|
}
|
269
|
}
|
258
|
}
|
270
|
}
|
259
|
|
271
|
|