作者 邓超

优化同步

@@ -49,7 +49,7 @@ class SyncMail { @@ -49,7 +49,7 @@ class SyncMail {
49 $this->db = db(); 49 $this->db = db();
50 50
51 if(!is_array($email)){ 51 if(!is_array($email)){
52 - $email = $this->db->first(emailSql::first($email)); 52 + $email = $this->db->cache(3600)->first(emailSql::first($email));
53 if(!$email){ 53 if(!$email){
54 abort('未查询到邮箱'); 54 abort('未查询到邮箱');
55 } 55 }
@@ -183,26 +183,26 @@ class SyncMail { @@ -183,26 +183,26 @@ class SyncMail {
183 } 183 }
184 184
185 // 更新数量 185 // 更新数量
186 - $this->db->update(folderSql::$table,[  
187 - 'exsts' => $this->db->count(listsSql::listCount(  
188 - dbWhere(  
189 - [  
190 - 'folder_id'=>$this->getFolderId($folder->getName()),  
191 - 'deleted' => 0,  
192 - ]  
193 - )  
194 - )),  
195 - 'unseen' => $this->db->count(listsSql::listCount(  
196 - dbWhere(  
197 - [  
198 - 'folder_id'=>$this->getFolderId($folder->getName()),  
199 - 'seen' => 0,  
200 - 'deleted' => 0,  
201 - ]  
202 - )  
203 - )),  
204 - 'last_sync_time' => time()  
205 - ],dbWhere(['email_id'=>$this->emailId(),'uuid'=>md5($this->emailId().$folder->getName())]),false); 186 +// $this->db->update(folderSql::$table,[
  187 +// 'exsts' => $this->db->count(listsSql::listCount(
  188 +// dbWhere(
  189 +// [
  190 +// 'folder_id'=>$this->getFolderId($folder->getName()),
  191 +// 'deleted' => 0,
  192 +// ]
  193 +// )
  194 +// )),
  195 +// 'unseen' => $this->db->count(listsSql::listCount(
  196 +// dbWhere(
  197 +// [
  198 +// 'folder_id'=>$this->getFolderId($folder->getName()),
  199 +// 'seen' => 0,
  200 +// 'deleted' => 0,
  201 +// ]
  202 +// )
  203 +// )),
  204 +// 'last_sync_time' => time()
  205 +// ],dbWhere(['email_id'=>$this->emailId(),'uuid'=>md5($this->emailId().$folder->getName())]),false);
206 206
207 } 207 }
208 } 208 }