作者 邓超

x

@@ -53,17 +53,17 @@ class Folder extends Base { @@ -53,17 +53,17 @@ class Folder extends Base {
53 if($folder['email_id'] == $eid){ 53 if($folder['email_id'] == $eid){
54 unset($folder['email_id']); 54 unset($folder['email_id']);
55 // 总数 55 // 总数
56 - $folder['exsts'] = db()->count(listsSql::listCount(  
57 - dbWhere(['folder_id'=> $folder['id'], 'deleted' => 0])  
58 - ));  
59 - if($folder['folder']=='收件箱'){  
60 - // 未读  
61 - $folder['unseen'] = db()->count(listsSql::listCount(  
62 - dbWhere(['folder_id'=> $folder['id'], 'seen' => 0, 'deleted' => 0])  
63 - ));  
64 - }else{  
65 - $folder['unseen'] = 0;  
66 - } 56 +// $folder['exsts'] = db()->count(listsSql::listCount(
  57 +// dbWhere(['folder_id'=> $folder['id'], 'deleted' => 0])
  58 +// ));
  59 +// if($folder['folder']=='收件箱'){
  60 +// // 未读
  61 +// $folder['unseen'] = db()->count(listsSql::listCount(
  62 +// dbWhere(['folder_id'=> $folder['id'], 'seen' => 0, 'deleted' => 0])
  63 +// ));
  64 +// }else{
  65 +// $folder['unseen'] = 0;
  66 +// }
67 67
68 $data[$email][$k] = $folder; 68 $data[$email][$k] = $folder;
69 } 69 }
@@ -233,28 +233,28 @@ class SyncMail { @@ -233,28 +233,28 @@ class SyncMail {
233 _echo($this->emailId().' ===> '.$folder->getName().' ===> '.$num); 233 _echo($this->emailId().' ===> '.$folder->getName().' ===> '.$num);
234 } 234 }
235 } 235 }
236 - 236 + $fid = $this->getFolderId($folder->getName());
237 // 更新数量 237 // 更新数量
238 -// $this->db->update(folderSql::$table,[  
239 -// 'exsts' => $this->db->count(listsSql::listCount(  
240 -// dbWhere(  
241 -// [  
242 -// 'folder_id'=>$this->getFolderId($folder->getName()),  
243 -// 'deleted' => 0,  
244 -// ]  
245 -// )  
246 -// )),  
247 -// 'unseen' => $this->db->count(listsSql::listCount(  
248 -// dbWhere(  
249 -// [  
250 -// 'folder_id'=>$this->getFolderId($folder->getName()),  
251 -// 'seen' => 0,  
252 -// 'deleted' => 0,  
253 -// ]  
254 -// )  
255 -// )),  
256 -// 'last_sync_time' => time()  
257 -// ],dbWhere(['email_id'=>$this->emailId(),'uuid'=>md5($this->emailId().$folder->getName())]),false); 238 + $this->db->update(folderSql::$table,[
  239 + 'exsts' => $this->db->count(listsSql::listCount(
  240 + dbWhere(
  241 + [
  242 + 'folder_id'=>$fid,
  243 + 'deleted' => 0,
  244 + ]
  245 + )
  246 + )),
  247 + 'unseen' => $this->db->count(listsSql::listCount(
  248 + dbWhere(
  249 + [
  250 + 'folder_id'=>$fid,
  251 + 'seen' => 0,
  252 + 'deleted' => 0,
  253 + ]
  254 + )
  255 + )),
  256 + 'last_sync_time' => time()
  257 + ],dbWhere(['email_id'=>$this->emailId(),'id'=>$fid]),false);
258 258
259 } 259 }
260 } 260 }