作者 邓超

x

<?php
include_once "../vendor/autoload.php";
$fid = 1;
while ($fid){
$fid = db()->value(\Model\folderSql::first([
'id.>' => $fid
],
'`id`'
));
if(!$fid){
break;
}
// 总数
$folder['exsts'] = db()->count(\Model\listsSql::listCount(
dbWhere(['folder_id'=> $fid, 'deleted' => 0])
));
// 未读
$folder['unseen'] = db()->count(\Model\listsSql::listCount(
dbWhere(['folder_id'=> $fid, 'seen' => 0, 'deleted' => 0])
));
_echo('fid: '.$fid.' data: '.json_encode($folder));
db()->update(\Model\folderSql::$table,$folder,'`id` = '.$fid,false);
}
... ...
... ... @@ -233,28 +233,6 @@ class SyncMail {
_echo($this->emailId().' ===> '.$folder->getName().' ===> '.$num);
}
}
$fid = $this->getFolderId($folder->getName());
// 更新数量
$this->db->update(folderSql::$table,[
'exsts' => $this->db->count(listsSql::listCount(
dbWhere(
[
'folder_id'=>$fid,
'deleted' => 0,
]
)
)),
'unseen' => $this->db->count(listsSql::listCount(
dbWhere(
[
'folder_id'=>$fid,
'seen' => 0,
'deleted' => 0,
]
)
)),
'last_sync_time' => time()
],dbWhere(['email_id'=>$this->emailId(),'id'=>$fid]),false);
}
}
... ...