作者 邓超

x

@@ -296,14 +296,8 @@ class MailListV2 extends Base { @@ -296,14 +296,8 @@ class MailListV2 extends Base {
296 $where['is_hots'] = 0; 296 $where['is_hots'] = 0;
297 $lajiCount = db()->cache($this->cache)->count($sql . dbWhere($where)); 297 $lajiCount = db()->cache($this->cache)->count($sql . dbWhere($where));
298 } 298 }
299 - // 星标  
300 - if(in_array('flagged',$show_count_filed)) {  
301 - $where['flagged'] = 1;  
302 - unset($where['folder_id']);  
303 - $flaggedCount = db()->cache($this->cache)->count($sql . dbWhere($where));  
304 - }  
305 -// 收件箱  
306 - if(in_array('inbox',$show_count_filed)) { 299 +
  300 + // 收件箱
307 $where['folder_id'] = $this->getFolderId('收件箱'); 301 $where['folder_id'] = $this->getFolderId('收件箱');
308 $where['is_hots'] = 0; 302 $where['is_hots'] = 0;
309 303
@@ -333,7 +327,7 @@ class MailListV2 extends Base { @@ -333,7 +327,7 @@ class MailListV2 extends Base {
333 327
334 328
335 $shouCount = db()->cache($this->cache)->count($sql . dbWhere($where)); 329 $shouCount = db()->cache($this->cache)->count($sql . dbWhere($where));
336 - } 330 +
337 // 未读 331 // 未读
338 if(in_array('unseen',$show_count_filed)) { 332 if(in_array('unseen',$show_count_filed)) {
339 $where['seen'] = 0; 333 $where['seen'] = 0;
@@ -341,6 +335,12 @@ class MailListV2 extends Base { @@ -341,6 +335,12 @@ class MailListV2 extends Base {
341 $seenCount = db()->cache($this->cache)->count($sql . dbWhere($where)); 335 $seenCount = db()->cache($this->cache)->count($sql . dbWhere($where));
342 unset($where['seen']); 336 unset($where['seen']);
343 } 337 }
  338 + // 星标
  339 + if(in_array('flagged',$show_count_filed)) {
  340 + $where['flagged'] = 1;
  341 + unset($where['folder_id']);
  342 + $flaggedCount = db()->cache($this->cache)->count($sql . dbWhere($where));
  343 + }
344 344
345 $data = []; 345 $data = [];
346 if(isset($shouCount)) $data['inbox'] = $shouCount; 346 if(isset($shouCount)) $data['inbox'] = $shouCount;