作者 邓超

xxx

... ... @@ -147,6 +147,7 @@ class Home extends Base {
$where['answered'] = app()->request('answered',0,'bool_Val')?1:0;
}
// 这个主要是来筛选 是否是自己发送的
$fromto = app()->request('formorto');
if($fromto=='from'){
$where['from'] = $this->getEmails('email');
... ... @@ -154,6 +155,24 @@ class Home extends Base {
$where['from.notin'] = $this->getEmails('email');
}
/**
* 不查询哪些发件人的邮件
*/
$form_not_in = app()->request('form_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){
$where['from.notin'] = $form_not_in;
}
}
$lists = db()->all(
listsSql::lists(
dbWhere($where),
... ...
... ... @@ -166,7 +166,7 @@ function dbWhere(array $where, string $ar = 'and'):string{
// 只有一个值时就是 =
$sql[] = "`{$f}` = ".$v[0];
}elseif (count($v) > 1){
$sql[] = "`{$f}` ".($t=='notin'?'not in':'in')." (".implode(',',$v).")";
$sql[] = "`{$f}` ".($t=='notin'?'not in':'in')." (".implode(',',array_map(function ($v){return "'".addslashes($v)."'";},$v)).")";
}
}else{
... ...