...
|
...
|
@@ -180,7 +180,7 @@ class MailListV2Es2 extends Base { |
|
|
// 软删
|
|
|
$where['deleted'] = 0;
|
|
|
$where['source'] = 2; // ai邮件群体
|
|
|
// $where['email_id'] = $this->getEmails('id');
|
|
|
if(count($this->getEmails('id')) == 1) $where['email_id'] = $this->getEmails('id');
|
|
|
|
|
|
$query = [
|
|
|
'bool'=>[
|
...
|
...
|
@@ -235,7 +235,7 @@ class MailListV2Es2 extends Base { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// logs(json_encode(['query'=>['constant_score'=>['filter'=>$query]]]));
|
|
|
logs('lists '.json_encode(['query'=>['constant_score'=>['filter'=>$query]]]));
|
|
|
$result = $this->es->search(['query'=>['constant_score'=>['filter'=>$query]]],($page-1) * $limit,$limit,['udate'=>"desc"]);
|
|
|
|
|
|
|
...
|
...
|
@@ -357,6 +357,7 @@ class MailListV2Es2 extends Base { |
|
|
]
|
|
|
]
|
|
|
];
|
|
|
if(count($this->getEmails('id')) == 1) $body['query']['bool']['must'][] = ['terms'=>['email_id'=>$this->getEmails('id')]];
|
|
|
// 时间 必须是数组
|
|
|
$udate = app()->request('udate');
|
|
|
if($udate && is_array($udate) && count($udate) == 2){
|
...
|
...
|
@@ -440,7 +441,9 @@ class MailListV2Es2 extends Base { |
|
|
private function countHot($body,$folder){
|
|
|
$body['query']['bool']['must'][] = ['term'=>['is_hots'=>1]];
|
|
|
$body['query']['bool']['must'][] = ['term'=>['folder_as_int'=>folder2int($folder)]];
|
|
|
$body['query']['bool']['must'][] = $this->assignSql3($folder);
|
|
|
if($this->assignSql3($folder))
|
|
|
$body['query']['bool']['must'][] = $this->assignSql3($folder);
|
|
|
logs('hot hot:'.json_encode($body));
|
|
|
return $this->es->count($body);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -468,9 +471,11 @@ class MailListV2Es2 extends Base { |
|
|
if($seen!==null){
|
|
|
$body['query']['bool']['must'][] = ['term'=>['seen'=>$seen]];
|
|
|
}
|
|
|
$body['query']['bool']['must'][] = ['term'=>['is_hots'=>0]];
|
|
|
if(in_array($folder,['收件箱','发件箱']))
|
|
|
$body['query']['bool']['must'][] = ['term'=>['is_hots'=>0]];
|
|
|
$body['query']['bool']['must'][] = ['term'=>['folder_as_int'=>folder2int($folder)]];
|
|
|
$body['query']['bool']['must'][] = $this->assignSql($folder);
|
|
|
if($this->assignSql($folder)) $body['query']['bool']['must'][] = $this->assignSql($folder);
|
|
|
logs('count :'.json_encode($body));
|
|
|
return $this->es->count($body);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -483,7 +488,8 @@ class MailListV2Es2 extends Base { |
|
|
*/
|
|
|
private function countFlagged($body){
|
|
|
$body['query']['bool']['must'][] = ['term'=>['flagged'=>1]];
|
|
|
$body['query']['bool']['must'][] = $this->assignSql('收件箱');
|
|
|
if($this->assignSql('收件箱'))
|
|
|
$body['query']['bool']['must'][] = $this->assignSql('收件箱');
|
|
|
return $this->es->count($body);
|
|
|
}
|
|
|
|
...
|
...
|
|