作者 邓超

es

1 -<?php  
2 -  
3 -/**  
4 - * 检查邮件同步时出现的空数据,很奇怪  
5 - * 定时任务,每1小时执行一次  
6 - */  
7 -  
8 -require_once "../vendor/autoload.php";  
9 -  
10 -  
11 -$id = redis()->get('empty_subject_check',185163874);  
12 -while($id){  
13 -  
14 - $list = db()->first(\Model\listsSql::first('`id` > '.$id.' and `subject` = "" and `from` = ""','`id`,`email_id`,`folder_id`,`uid`'));  
15 - if(!$list){  
16 - break;  
17 - }  
18 - $id = $list['id']??0;  
19 -  
20 - echo $id."\n";  
21 -  
22 - $email = db()->first(\Model\emailSql::first($list['email_id']));  
23 -  
24 -  
25 - $folder = db()->first(\Model\folderSql::first($list['folder_id']));  
26 - if(!$folder){continue;}  
27 -  
28 - (new \Service\SyncMail($list['email_id']))->mail($folder['origin_folder'],[$list['uid']]);  
29 -  
30 -}  
31 -  
32 -redis()->set('empty_subject_check',$id);  
33 -  
34 -