作者 邓超

x

@@ -281,6 +281,32 @@ class MailListV2 extends Base { @@ -281,6 +281,32 @@ class MailListV2 extends Base {
281 if(in_array('inbox',$show_count_filed)) { 281 if(in_array('inbox',$show_count_filed)) {
282 $where['folder_id'] = $this->getFolderId('收件箱'); 282 $where['folder_id'] = $this->getFolderId('收件箱');
283 $where['is_hots'] = 0; 283 $where['is_hots'] = 0;
  284 +
  285 + // 模糊标题搜索
  286 + $subject = app()->request('subject');
  287 + if($subject){
  288 + $subject = is_array($subject) ? $subject : [$subject];
  289 + foreach ($subject as $k=>$sub){
  290 + $subject[$k] = '`subject` '.(empty($is_auto_inbox)?' not ':'').'like "%%'.addslashes($sub).'%%"';
  291 + }
  292 + }
  293 + // 不在此邮箱中的
  294 + $from_not_in_like = app()->request('from_not_in_like');
  295 + if($from_not_in_like){
  296 + $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like];
  297 + foreach ($from_not_in_like as $k=>$sub){
  298 + $from_not_in_like[$k] = '`from` '.(empty($is_auto_inbox)?' not ':'').'like "%%'.addslashes($sub).'%%"';
  299 + }
  300 + }
  301 +
  302 + if($subject || $from_not_in_like){
  303 + $sql .= ' (';
  304 + if($subject) $sql.= implode(' and ',$subject);
  305 + if($from_not_in_like) $sql.= ' and '.implode(' and ',$from_not_in_like);
  306 + $sql .= ') and ';
  307 + }
  308 +
  309 +
284 $shouCount = db()->cache($this->cache)->count($sql . dbWhere($where)); 310 $shouCount = db()->cache($this->cache)->count($sql . dbWhere($where));
285 } 311 }
286 // 未读 312 // 未读