|
...
|
...
|
@@ -84,6 +84,7 @@ class MailListV2Es2 extends Base { |
|
|
|
else if($folder=='星标邮件'||$folder=='Starred'){
|
|
|
|
$where['flagged'] = 1; // 星标
|
|
|
|
$where['folder_as_int'] = [1,2,3,4,5]; // 所有
|
|
|
|
unset($where['is_hots'],$where['is_auto']);
|
|
|
|
}elseif ($folder=='预热收件箱'){
|
|
|
|
$where['is_hots'] = 1;
|
|
|
|
$where['folder_as_int'] = folder2int('收件箱');
|
|
...
|
...
|
@@ -505,7 +506,7 @@ class MailListV2Es2 extends Base { |
|
|
|
$body['query']['bool']['must'][] = ['term'=>['folder_as_int'=>folder2int($folder)]];
|
|
|
|
if($this->assignSql($folder)) $body['query']['bool']['must'][] = $this->assignSql($folder);
|
|
|
|
// logs('count :'.json_encode($body));
|
|
|
|
if(app()->request('nocache')!='web' || $folder=='垃圾箱' || $folder == '发件箱'){
|
|
|
|
if($folder=='垃圾箱' ){
|
|
|
|
$key = 'count:'.date('Ymd').md5(json_encode($body));
|
|
|
|
$a = redis()->get($key);
|
|
|
|
if(!is_numeric($a)){
|
|
...
|
...
|
@@ -531,15 +532,15 @@ class MailListV2Es2 extends Base { |
|
|
|
if($this->assignSql('收件箱'))
|
|
|
|
$body['query']['bool']['must'][] = $this->assignSql('收件箱');
|
|
|
|
|
|
|
|
if(app()->request('nocache')!='web'){
|
|
|
|
$key = 'flagged_count:'.md5(json_encode($body));
|
|
|
|
$a = redis()->get($key);
|
|
|
|
if(!is_numeric($a)){
|
|
|
|
$a = $this->es->count($body);
|
|
|
|
redis()->set($key,$a,3600);
|
|
|
|
}
|
|
|
|
return $a;
|
|
|
|
}
|
|
|
|
|
|
|
|
// $key = 'flagged_count:'.md5(json_encode($body));
|
|
|
|
// $a = redis()->get($key);
|
|
|
|
// if(!is_numeric($a)){
|
|
|
|
// $a = $this->es->count($body);
|
|
|
|
// redis()->set($key,$a,3600);
|
|
|
|
// }
|
|
|
|
// return $a;
|
|
|
|
|
|
|
|
|
|
|
|
return $this->es->count($body);
|
|
|
|
}
|
...
|
...
|
|