作者 邓超

x

... ... @@ -191,30 +191,31 @@ class MailListV2 extends Base {
$sql = "select %s from `lists` where ".dbWhere($where);
/************ 2024-09-02 *************/
if($folder=='收件箱') {
// 模糊标题搜索
$subject = app()->request('subject');
if($subject){
if ($subject) {
$subject = is_array($subject) ? $subject : [$subject];
foreach ($subject as $k=>$sub){
$subject[$k] = '`subject` '.(empty($is_auto_inbox)?' not ':'').'like "'.$this->getLikeStr($sub).'"';
foreach ($subject as $k => $sub) {
$subject[$k] = '`subject` ' . (empty($is_auto_inbox) ? ' not ' : '') . 'like "' . $this->getLikeStr($sub) . '"';
}
}
// 不在此邮箱中的
$from_not_in_like = app()->request('from_not_in_like');
if($from_not_in_like){
if ($from_not_in_like) {
$from_not_in_like = is_array($from_not_in_like) ? $from_not_in_like : [$from_not_in_like];
foreach ($from_not_in_like as $k=>$sub){
$from_not_in_like[$k] = '`from` '.(empty($is_auto_inbox)?' not ':'').'like "'.$this->getLikeStr($sub).'"';
foreach ($from_not_in_like as $k => $sub) {
$from_not_in_like[$k] = '`from` ' . (empty($is_auto_inbox) ? ' not ' : '') . 'like "' . $this->getLikeStr($sub) . '"';
}
}
if($subject || $from_not_in_like){
if ($subject || $from_not_in_like) {
$sql .= ' and (';
if($subject) $sql.= implode(empty($is_auto_inbox)?' and ':' or ',$subject);
if($from_not_in_like) $sql.= ' and ('.implode(empty($is_auto_inbox)?' and ':' or ',$from_not_in_like).')';
if ($subject) $sql .= implode(empty($is_auto_inbox) ? ' and ' : ' or ', $subject);
if ($from_not_in_like) $sql .= ' and (' . implode(empty($is_auto_inbox) ? ' and ' : ' or ', $from_not_in_like) . ')';
$sql .= ')';
}
}
/************ 2024-09-02 *************/
... ...