empty_subject_check.php
755 字节
<?php
/**
* 检查邮件同步时出现的空数据,很奇怪
* 定时任务,每1小时执行一次
*/
require_once "../vendor/autoload.php";
$id = redis()->get('empty_subject_check',185163874);
while($id){
$list = db()->first(\Model\listsSql::first('`id` > '.$id.' and `subject` = "" and `from` = ""','`id`,`email_id`,`folder_id`,`uid`'));
if(!$list){
break;
}
$id = $list['id']??0;
echo $id."\n";
$email = db()->first(\Model\emailSql::first($list['email_id']));
$folder = db()->first(\Model\folderSql::first($list['folder_id']));
if(!$folder){continue;}
(new \Service\SyncMail($list['email_id']))->mail($folder['origin_folder'],[$list['uid']]);
}
redis()->set('empty_subject_check',$id);