作者 邓超

x

@@ -176,18 +176,24 @@ class MailListV2 extends Base { @@ -176,18 +176,24 @@ class MailListV2 extends Base {
176 // 模糊标题搜索 176 // 模糊标题搜索
177 $subject = app()->request('subject'); 177 $subject = app()->request('subject');
178 if($subject){ 178 if($subject){
  179 + $sql.=' and (';
179 $subject = is_array($subject) ? $subject : [$subject]; 180 $subject = is_array($subject) ? $subject : [$subject];
180 foreach ($subject as $sub){ 181 foreach ($subject as $sub){
181 - $sql.=' and `subject` '.(empty($is_auto_inbox)?' not ':'').'like "%%'.addslashes($sub).'%%"'; 182 + $sql.=' `subject` '.(empty($is_auto_inbox)?' not ':'').'like "%%'.addslashes($sub).'%%" or ';
182 } 183 }
  184 + $sql = rtrim($sql,'or ');
  185 + $sql.=')';
183 } 186 }
184 // 不在此邮箱中的 187 // 不在此邮箱中的
185 $from_not_in_like = app()->request('from_not_in_like'); 188 $from_not_in_like = app()->request('from_not_in_like');
186 if($from_not_in_like){ 189 if($from_not_in_like){
  190 + $sql.=' and (';
187 $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like]; 191 $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like];
188 foreach ($from_not_in_like as $sub){ 192 foreach ($from_not_in_like as $sub){
189 - $sql.=' and `from` '.(empty($is_auto_inbox)?' not ':'').'like "%%'.addslashes($sub).'%%"'; 193 + $sql.='`from` '.(empty($is_auto_inbox)?' not ':'').'like "%%'.addslashes($sub).'%%" or ';
190 } 194 }
  195 + $sql = rtrim($sql,'or ');
  196 + $sql.=')';
191 } 197 }
192 /************ 2024-09-02 *************/ 198 /************ 2024-09-02 *************/
193 199