作者 邓超

x

@@ -158,7 +158,7 @@ class Home extends Base { @@ -158,7 +158,7 @@ class Home extends Base {
158 /** 158 /**
159 * 不查询哪些发件人的邮件 159 * 不查询哪些发件人的邮件
160 */ 160 */
161 - $form_not_in = app()->request('form_not_in'); 161 + $form_not_in = app()->request('from_not_in');
162 if($form_not_in){ 162 if($form_not_in){
163 $form_not_in = is_array($form_not_in) ? $form_not_in : [$form_not_in]; 163 $form_not_in = is_array($form_not_in) ? $form_not_in : [$form_not_in];
164 $form_not_in = array_filter($form_not_in,function ($v){ 164 $form_not_in = array_filter($form_not_in,function ($v){
@@ -168,9 +168,15 @@ class Home extends Base { @@ -168,9 +168,15 @@ class Home extends Base {
168 return false; 168 return false;
169 }); 169 });
170 if($form_not_in){ 170 if($form_not_in){
171 - $where['from.notin'] = $form_not_in; 171 + if(isset($where['from.notin'])){
  172 + $where['from.notin'] = array_merge($where['from.notin'],$form_not_in);
  173 + }else{
  174 + $where['from.notin'] = $form_not_in;
  175 + }
  176 +
172 } 177 }
173 } 178 }
  179 + $where['from.notin'] = array_unique($where['from.notin']);
174 180
175 181
176 $lists = db()->all( 182 $lists = db()->all(
@@ -163,8 +163,13 @@ function dbWhere(array $where, string $ar = 'and'):string{ @@ -163,8 +163,13 @@ function dbWhere(array $where, string $ar = 'and'):string{
163 return $n; 163 return $n;
164 },$v); 164 },$v);
165 if(count($v)===1){ 165 if(count($v)===1){
166 - // 只有一个值时就是 =  
167 - $sql[] = "`{$f}` = ".$v[0]; 166 + if($t=='notin'){
  167 + $sql[] = "`{$f}` != ".$v[0];
  168 + }else{
  169 + // 只有一个值时就是 =
  170 + $sql[] = "`{$f}` = ".$v[0];
  171 + }
  172 +
168 }elseif (count($v) > 1){ 173 }elseif (count($v) > 1){
169 $sql[] = "`{$f}` ".($t=='notin'?'not in':'in')." (".implode(',',$v).")"; 174 $sql[] = "`{$f}` ".($t=='notin'?'not in':'in')." (".implode(',',$v).")";
170 } 175 }