作者 邓超

v2 调整

@@ -135,6 +135,26 @@ class Home extends Base { @@ -135,6 +135,26 @@ class Home extends Base {
135 135
136 // 通过时间来搜索uid 136 // 通过时间来搜索uid
137 $uids = $mail->client->search(['SINCE'=>date('d-M-Y',$udate)],true); 137 $uids = $mail->client->search(['SINCE'=>date('d-M-Y',$udate)],true);
  138 + if ($uids){
  139 + // 已有的uid
  140 + $useuids = db()->all(
  141 + sprintf(
  142 + "select `uid` from `%s` where `email_id` = %d and `folder_id` = %d and `uid` in (%s)",
  143 + listsSql::$table,
  144 + $email['id'],
  145 + $folder['id'],
  146 + implode(',',$uids)
  147 + )
  148 + );
  149 + $useuids = $useuids ? array_column($useuids,'uid') : [];
  150 + if($useuids){
  151 + // 删除多余的
  152 + foreach ($uids as $k=>$uid){
  153 + if(in_array($uid,$useuids)){
  154 + unset($uids[$k]);
  155 + }
  156 + }
  157 + }
138 158
139 // 进行同步 159 // 进行同步
140 $mail->syncUidEmail( 160 $mail->syncUidEmail(
@@ -147,6 +167,8 @@ class Home extends Base { @@ -147,6 +167,8 @@ class Home extends Base {
147 db() 167 db()
148 ); 168 );
149 } 169 }
  170 +
  171 + }
150 } 172 }
151 173
152 174