正在显示
1 个修改的文件
包含
13 行增加
和
5 行删除
@@ -109,6 +109,11 @@ class MailListV2Es2 extends Base { | @@ -109,6 +109,11 @@ class MailListV2Es2 extends Base { | ||
109 | if($keyword){ | 109 | if($keyword){ |
110 | $where['subject'] = $keyword; | 110 | $where['subject'] = $keyword; |
111 | } | 111 | } |
112 | + $query = [ | ||
113 | + 'bool'=>[ | ||
114 | + 'must' => [] | ||
115 | + ] | ||
116 | + ]; | ||
112 | // 联系人 | 117 | // 联系人 |
113 | $address = app()->request('address'); | 118 | $address = app()->request('address'); |
114 | if($address){ | 119 | if($address){ |
@@ -121,6 +126,13 @@ class MailListV2Es2 extends Base { | @@ -121,6 +126,13 @@ class MailListV2Es2 extends Base { | ||
121 | $where['from.email'] = $address['from']; | 126 | $where['from.email'] = $address['from']; |
122 | } | 127 | } |
123 | } | 128 | } |
129 | + }else{ | ||
130 | + $query['bool']['must'][] = [ | ||
131 | + "bool" => ["should"=>[ | ||
132 | + ["match_phrase" => ["from.email"=>$address]], | ||
133 | + ["match_phrase" => ["to"=>$address]], | ||
134 | + ]] | ||
135 | + ]; | ||
124 | } | 136 | } |
125 | } | 137 | } |
126 | 138 | ||
@@ -140,11 +152,7 @@ class MailListV2Es2 extends Base { | @@ -140,11 +152,7 @@ class MailListV2Es2 extends Base { | ||
140 | unset($where['is_hots'],$where['is_auto'],$where['deleted']); | 152 | unset($where['is_hots'],$where['is_auto'],$where['deleted']); |
141 | } | 153 | } |
142 | 154 | ||
143 | - $query = [ | ||
144 | - 'bool'=>[ | ||
145 | - 'must' => [] | ||
146 | - ] | ||
147 | - ]; | 155 | + |
148 | foreach ($where as $k=>$v){ | 156 | foreach ($where as $k=>$v){ |
149 | if($k=='subject'){ | 157 | if($k=='subject'){ |
150 | if($v){ | 158 | if($v){ |
-
请 注册 或 登录 后发表评论