作者 邓超

es

... ... @@ -303,7 +303,7 @@ class MailListV2Es extends Base {
$afids = array_values(array_diff($this->getFolderId($folder),$fids));
if($query && $afids){
$query = [
return [
'query' =>[
'bool' => [
'must' => [
... ... @@ -316,15 +316,7 @@ class MailListV2Es extends Base {
]
];
}else if($afids){
return [
'query' =>[
'bool' => [
'must' =>[
['terms'=>['folder_id'=>$afids]]
]
]
]
];
return ['terms'=>['folder_id'=>$afids]];
}else if($query&&!$afids){
return $query;
}
... ... @@ -385,13 +377,7 @@ class MailListV2Es extends Base {
]];
}
return ['query'=>[
'bool'=> [
'must'=>[
['terms'=>['email_id'=>$email2]]
]
]
]];
return ['terms'=>['email_id'=>$email2]];
}
if($sql){
... ... @@ -401,23 +387,11 @@ class MailListV2Es extends Base {
}
return [
'query'=>[
'bool'=> [
'must'=>[['term'=>['email_id'=>-1]]]
]
]
];
return ['term'=>['email_id'=>-1]];
}
// 默认
return [
'query'=>[
'bool'=> [
'must'=>[['terms'=>['email_id'=> $this->getEmails('id')]]]
]
]
];
return ['terms'=>['email_id'=> $this->getEmails('id')]];
}
... ... @@ -432,40 +406,15 @@ class MailListV2Es extends Base {
$fids = $this->getFolderId($folder,$email);
// 有目录id和from
if($fids){
return [
'query'=>[
'bool' =>[
'must' =>[
['terms'=>['folder_id'=>$fids]]
]
]
]
];
return ['terms'=>['folder_id'=>$fids]];
}
}
return [
'query'=>[
'bool' =>[
'must' =>[
['term'=>['folder_id'=>-1]]
]
]
]
];
return ['term'=>['folder_id'=>-1]];
}
return [
'query'=>[
'bool' =>[
'must' =>[
['terms'=>['folder_id'=> $this->getFolderId($folder)]]
]
]
]
];
return dbWhere(['folder_id'=>$this->getFolderId($folder)]).' and ';
return ['terms'=>['folder_id'=> $this->getFolderId($folder)]];
}
... ...