正在显示
1 个修改的文件
包含
25 行增加
和
25 行删除
@@ -263,7 +263,6 @@ class MailListV2 extends Base { | @@ -263,7 +263,6 @@ class MailListV2 extends Base { | ||
263 | 263 | ||
264 | $sql = "select count(*) from `lists` where "; | 264 | $sql = "select count(*) from `lists` where "; |
265 | 265 | ||
266 | - $where = ['email_id'=>$emails]; | ||
267 | $where['deleted'] = 0; //未删状态 | 266 | $where['deleted'] = 0; //未删状态 |
268 | // 屏蔽哪些邮件 | 267 | // 屏蔽哪些邮件 |
269 | // $where['from.notin'] = $this->from_not_in(); | 268 | // $where['from.notin'] = $this->from_not_in(); |
@@ -297,36 +296,36 @@ class MailListV2 extends Base { | @@ -297,36 +296,36 @@ class MailListV2 extends Base { | ||
297 | $lajiCount = db()->cache($this->cache)->count($sql . dbWhere($where)); | 296 | $lajiCount = db()->cache($this->cache)->count($sql . dbWhere($where)); |
298 | } | 297 | } |
299 | 298 | ||
300 | - // 收件箱 | ||
301 | - $where['folder_id'] = $this->getFolderId('收件箱'); | ||
302 | - $where['is_hots'] = 0; | 299 | + // 收件箱 |
300 | + $where['folder_id'] = $this->getFolderId('收件箱'); | ||
301 | + $where['is_hots'] = 0; | ||
303 | 302 | ||
304 | - // 模糊标题搜索 | ||
305 | - $subject = app()->request('subject'); | ||
306 | - if($subject){ | ||
307 | - $subject = is_array($subject) ? $subject : [$subject]; | ||
308 | - foreach ($subject as $k=>$sub){ | ||
309 | - $subject[$k] = '`subject` not like "'.$this->getLikeStr($sub).'"'; | ||
310 | - } | 303 | + // 模糊标题搜索 |
304 | + $subject = app()->request('subject'); | ||
305 | + if($subject){ | ||
306 | + $subject = is_array($subject) ? $subject : [$subject]; | ||
307 | + foreach ($subject as $k=>$sub){ | ||
308 | + $subject[$k] = '`subject` not like "'.$this->getLikeStr($sub).'"'; | ||
311 | } | 309 | } |
312 | - // 不在此邮箱中的 | ||
313 | - $from_not_in_like = app()->request('from_not_in_like'); | ||
314 | - if($from_not_in_like){ | ||
315 | - $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like]; | ||
316 | - foreach ($from_not_in_like as $k=>$sub){ | ||
317 | - $from_not_in_like[$k] = '`from` not like "'.$this->getLikeStr($sub).'"'; | ||
318 | - } | 310 | + } |
311 | + // 不在此邮箱中的 | ||
312 | + $from_not_in_like = app()->request('from_not_in_like'); | ||
313 | + if($from_not_in_like){ | ||
314 | + $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like]; | ||
315 | + foreach ($from_not_in_like as $k=>$sub){ | ||
316 | + $from_not_in_like[$k] = '`from` not like "'.$this->getLikeStr($sub).'"'; | ||
319 | } | 317 | } |
318 | + } | ||
320 | 319 | ||
321 | - if($subject || $from_not_in_like){ | ||
322 | - $sql .= ' ('; | ||
323 | - if($subject) $sql.= implode(' and ',$subject); | ||
324 | - if($from_not_in_like) $sql.= ' and ('.implode(' and ',$from_not_in_like).')'; | ||
325 | - $sql .= ') and '; | ||
326 | - } | 320 | + if($subject || $from_not_in_like){ |
321 | + $sql .= ' ('; | ||
322 | + if($subject) $sql.= implode(' and ',$subject); | ||
323 | + if($from_not_in_like) $sql.= ' and ('.implode(' and ',$from_not_in_like).')'; | ||
324 | + $sql .= ') and '; | ||
325 | + } | ||
327 | 326 | ||
328 | 327 | ||
329 | - $shouCount = db()->cache($this->cache)->count($sql . dbWhere($where)); | 328 | + $shouCount = db()->cache($this->cache)->count($sql . dbWhere($where)); |
330 | 329 | ||
331 | // 未读 | 330 | // 未读 |
332 | if(in_array('unseen',$show_count_filed)) { | 331 | if(in_array('unseen',$show_count_filed)) { |
@@ -339,6 +338,7 @@ class MailListV2 extends Base { | @@ -339,6 +338,7 @@ class MailListV2 extends Base { | ||
339 | if(in_array('flagged',$show_count_filed)) { | 338 | if(in_array('flagged',$show_count_filed)) { |
340 | $where['flagged'] = 1; | 339 | $where['flagged'] = 1; |
341 | unset($where['folder_id']); | 340 | unset($where['folder_id']); |
341 | + $where = ['email_id'=>$emails]; | ||
342 | $flaggedCount = db()->cache($this->cache)->count($sql . dbWhere($where)); | 342 | $flaggedCount = db()->cache($this->cache)->count($sql . dbWhere($where)); |
343 | } | 343 | } |
344 | 344 |
-
请 注册 或 登录 后发表评论