作者 邓超

x

@@ -191,30 +191,31 @@ class MailListV2 extends Base { @@ -191,30 +191,31 @@ class MailListV2 extends Base {
191 $sql = "select %s from `lists` where ".dbWhere($where); 191 $sql = "select %s from `lists` where ".dbWhere($where);
192 192
193 /************ 2024-09-02 *************/ 193 /************ 2024-09-02 *************/
  194 + if($folder=='收件箱') {
194 // 模糊标题搜索 195 // 模糊标题搜索
195 $subject = app()->request('subject'); 196 $subject = app()->request('subject');
196 - if($subject){ 197 + if ($subject) {
197 $subject = is_array($subject) ? $subject : [$subject]; 198 $subject = is_array($subject) ? $subject : [$subject];
198 - foreach ($subject as $k=>$sub){  
199 - $subject[$k] = '`subject` '.(empty($is_auto_inbox)?' not ':'').'like "'.$this->getLikeStr($sub).'"'; 199 + foreach ($subject as $k => $sub) {
  200 + $subject[$k] = '`subject` ' . (empty($is_auto_inbox) ? ' not ' : '') . 'like "' . $this->getLikeStr($sub) . '"';
200 } 201 }
201 } 202 }
202 // 不在此邮箱中的 203 // 不在此邮箱中的
203 $from_not_in_like = app()->request('from_not_in_like'); 204 $from_not_in_like = app()->request('from_not_in_like');
204 - if($from_not_in_like){ 205 + if ($from_not_in_like) {
205 $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like]; 206 $from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like];
206 - foreach ($from_not_in_like as $k=>$sub){  
207 - $from_not_in_like[$k] = '`from` '.(empty($is_auto_inbox)?' not ':'').'like "'.$this->getLikeStr($sub).'"'; 207 + foreach ($from_not_in_like as $k => $sub) {
  208 + $from_not_in_like[$k] = '`from` ' . (empty($is_auto_inbox) ? ' not ' : '') . 'like "' . $this->getLikeStr($sub) . '"';
208 } 209 }
209 } 210 }
210 211
211 - if($subject || $from_not_in_like){ 212 + if ($subject || $from_not_in_like) {
212 $sql .= ' and ('; 213 $sql .= ' and (';
213 - if($subject) $sql.= implode(empty($is_auto_inbox)?' and ':' or ',$subject);  
214 - if($from_not_in_like) $sql.= ' and ('.implode(empty($is_auto_inbox)?' and ':' or ',$from_not_in_like).')'; 214 + if ($subject) $sql .= implode(empty($is_auto_inbox) ? ' and ' : ' or ', $subject);
  215 + if ($from_not_in_like) $sql .= ' and (' . implode(empty($is_auto_inbox) ? ' and ' : ' or ', $from_not_in_like) . ')';
215 $sql .= ')'; 216 $sql .= ')';
216 } 217 }
217 - 218 + }
218 219
219 /************ 2024-09-02 *************/ 220 /************ 2024-09-02 *************/
220 221