作者 邓超

fob

@@ -72,9 +72,9 @@ class HotMail { @@ -72,9 +72,9 @@ class HotMail {
72 foreach ($folders as $f){ 72 foreach ($folders as $f){
73 if(folderAlias($f['folder']) == $folder){ 73 if(folderAlias($f['folder']) == $folder){
74 // 最后记录的id 74 // 最后记录的id
75 - $last_id = db()->value('select max(`lists_id`) from `fob_hot_mail` where `email_id` = '.$email_id.' and `folder` = "'.$type.'" limit 1');  
76 - $last_id = $last_id?$last_id:0;  
77 - $this->findList(new Data($email_id,$f['id'],$type,$last_id)); 75 +// $last_id = db()->value('select max(`lists_id`) from `fob_hot_mail` where `email_id` = '.$email_id.' and `folder` = "'.$type.'" limit 1');
  76 +// $last_id = $last_id?$last_id:0;
  77 + $this->findList(new Data($email_id,$f['id'],$type,0));
78 } 78 }
79 } 79 }
80 return true; 80 return true;
@@ -88,9 +88,8 @@ class HotMail { @@ -88,9 +88,8 @@ class HotMail {
88 private function findList(Data $data, int $p = 1){ 88 private function findList(Data $data, int $p = 1){
89 $lists = db()->all( 89 $lists = db()->all(
90 sprintf( 90 sprintf(
91 - "select `id`,`folder_id`,`email_id`,`%s` from `lists` where `id` > %d and `email_id` = %d and `folder_id` = %d and (select count(*) from `fob_hot_mail` where `lists`.`id` = `fob_hot_mail`.`lists_id`) = 0 order by `id` asc limit 1000 offset ".(($p-1)*1000), 91 + "select `id`,`folder_id`,`email_id`,`%s` from `lists` left join `fob_hot_mail` on `fob_hot_mail`.`lists_id` = `lists`.`id` where `email_id` = %d and `folder_id` = %d and `fob_hot_mail`.`lists_id` is null order by `id` asc limit 1000 offset ".(($p-1)*1000),
92 $data->type=='s' ? 'from':'to_name', // 收件箱查询 from字段 发件箱 查询 to_name字段 92 $data->type=='s' ? 'from':'to_name', // 收件箱查询 from字段 发件箱 查询 to_name字段
93 - $data->last_id,  
94 $data->email_id, 93 $data->email_id,
95 $data->folder_id 94 $data->folder_id
96 ) 95 )