作者 邓超

fob

... ... @@ -46,6 +46,33 @@ class MailList extends Base {
}
private function from_not_in(){
$where['from.notin'] = [];
/**
* 不查询哪些发件人的邮件
*/
$form_not_in = app()->request('from_not_in');
if($form_not_in){
$form_not_in = is_array($form_not_in) ? $form_not_in : [$form_not_in];
$form_not_in = array_filter($form_not_in,function ($v){
if(is_string($v) && Verify::sEmail($v)){
return true;
}
return false;
});
if($form_not_in){
if(isset($where['from.notin'])){
$where['from.notin'] = array_merge($where['from.notin'],$form_not_in);
}else{
$where['from.notin'] = $form_not_in;
}
}
}
return $where['from.notin'];
}
/**
* 邮件列表
* 接收参数
... ... @@ -113,31 +140,8 @@ class MailList extends Base {
// 软删
$where['deleted'] = 0;
/**
* 不查询哪些发件人的邮件
*/
$form_not_in = app()->request('from_not_in');
if($form_not_in){
$form_not_in = is_array($form_not_in) ? $form_not_in : [$form_not_in];
$form_not_in = array_filter($form_not_in,function ($v){
if(is_string($v) && Verify::sEmail($v)){
return true;
}
return false;
});
if($form_not_in){
if(isset($where['from.notin'])){
$where['from.notin'] = array_merge($where['from.notin'],$form_not_in);
}else{
$where['from.notin'] = $form_not_in;
}
}
}
if(!empty($where['from.notin'])){
$where['from.notin'] = array_unique($where['from.notin']);
}
$where['from.notin'] = $this->from_not_in();
if(!$where['from.notin']) unset($where['from.notin']);
$filed = '`id`,`uid`,`subject`,`from`,`from_name`,`flagged`,`seen`,`udate`,`folder_id`,`is_file`,`description`,`lists`.`email_id`,`to_name`';
... ... @@ -202,6 +206,9 @@ class MailList extends Base {
$fCount = db()->count($sql.dbWhere($where));
// 屏蔽哪些邮件
$where['from.notin'] = $this->from_not_in();
if(!$where['from.notin']) unset($where['from.notin']);
$where = ['lists|email_id'=>$emails];
$where['folder_id'] = $this->getFolderId('发件箱');
... ...