作者 邓超

x

... ... @@ -158,7 +158,7 @@ class Home extends Base {
/**
* 不查询哪些发件人的邮件
*/
$form_not_in = app()->request('form_not_in');
$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){
... ... @@ -168,9 +168,15 @@ class Home extends Base {
return false;
});
if($form_not_in){
$where['from.notin'] = $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;
}
}
}
$where['from.notin'] = array_unique($where['from.notin']);
$lists = db()->all(
... ...
... ... @@ -163,8 +163,13 @@ function dbWhere(array $where, string $ar = 'and'):string{
return $n;
},$v);
if(count($v)===1){
// 只有一个值时就是 =
$sql[] = "`{$f}` = ".$v[0];
if($t=='notin'){
$sql[] = "`{$f}` != ".$v[0];
}else{
// 只有一个值时就是 =
$sql[] = "`{$f}` = ".$v[0];
}
}elseif (count($v) > 1){
$sql[] = "`{$f}` ".($t=='notin'?'not in':'in')." (".implode(',',$v).")";
}
... ...