...
|
...
|
@@ -263,7 +263,6 @@ class MailListV2 extends Base { |
|
|
|
|
|
$sql = "select count(*) from `lists` where ";
|
|
|
|
|
|
$where = ['email_id'=>$emails];
|
|
|
$where['deleted'] = 0; //未删状态
|
|
|
// 屏蔽哪些邮件
|
|
|
// $where['from.notin'] = $this->from_not_in();
|
...
|
...
|
@@ -297,36 +296,36 @@ class MailListV2 extends Base { |
|
|
$lajiCount = db()->cache($this->cache)->count($sql . dbWhere($where));
|
|
|
}
|
|
|
|
|
|
// 收件箱
|
|
|
$where['folder_id'] = $this->getFolderId('收件箱');
|
|
|
$where['is_hots'] = 0;
|
|
|
// 收件箱
|
|
|
$where['folder_id'] = $this->getFolderId('收件箱');
|
|
|
$where['is_hots'] = 0;
|
|
|
|
|
|
// 模糊标题搜索
|
|
|
$subject = app()->request('subject');
|
|
|
if($subject){
|
|
|
$subject = is_array($subject) ? $subject : [$subject];
|
|
|
foreach ($subject as $k=>$sub){
|
|
|
$subject[$k] = '`subject` not like "'.$this->getLikeStr($sub).'"';
|
|
|
}
|
|
|
// 模糊标题搜索
|
|
|
$subject = app()->request('subject');
|
|
|
if($subject){
|
|
|
$subject = is_array($subject) ? $subject : [$subject];
|
|
|
foreach ($subject as $k=>$sub){
|
|
|
$subject[$k] = '`subject` not like "'.$this->getLikeStr($sub).'"';
|
|
|
}
|
|
|
// 不在此邮箱中的
|
|
|
$from_not_in_like = app()->request('from_not_in_like');
|
|
|
if($from_not_in_like){
|
|
|
$from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like];
|
|
|
foreach ($from_not_in_like as $k=>$sub){
|
|
|
$from_not_in_like[$k] = '`from` not like "'.$this->getLikeStr($sub).'"';
|
|
|
}
|
|
|
}
|
|
|
// 不在此邮箱中的
|
|
|
$from_not_in_like = app()->request('from_not_in_like');
|
|
|
if($from_not_in_like){
|
|
|
$from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like];
|
|
|
foreach ($from_not_in_like as $k=>$sub){
|
|
|
$from_not_in_like[$k] = '`from` not like "'.$this->getLikeStr($sub).'"';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if($subject || $from_not_in_like){
|
|
|
$sql .= ' (';
|
|
|
if($subject) $sql.= implode(' and ',$subject);
|
|
|
if($from_not_in_like) $sql.= ' and ('.implode(' and ',$from_not_in_like).')';
|
|
|
$sql .= ') and ';
|
|
|
}
|
|
|
if($subject || $from_not_in_like){
|
|
|
$sql .= ' (';
|
|
|
if($subject) $sql.= implode(' and ',$subject);
|
|
|
if($from_not_in_like) $sql.= ' and ('.implode(' and ',$from_not_in_like).')';
|
|
|
$sql .= ') and ';
|
|
|
}
|
|
|
|
|
|
|
|
|
$shouCount = db()->cache($this->cache)->count($sql . dbWhere($where));
|
|
|
$shouCount = db()->cache($this->cache)->count($sql . dbWhere($where));
|
|
|
|
|
|
// 未读
|
|
|
if(in_array('unseen',$show_count_filed)) {
|
...
|
...
|
@@ -339,6 +338,7 @@ class MailListV2 extends Base { |
|
|
if(in_array('flagged',$show_count_filed)) {
|
|
|
$where['flagged'] = 1;
|
|
|
unset($where['folder_id']);
|
|
|
$where = ['email_id'=>$emails];
|
|
|
$flaggedCount = db()->cache($this->cache)->count($sql . dbWhere($where));
|
|
|
}
|
|
|
|
...
|
...
|
|