作者 邓超

优化同步

... ... @@ -69,18 +69,6 @@ class Home extends Base {
$udate = app()->request('udate',0,'intval');
$range = [
'uuid' => [
'gte' => $last_id, // 大于等于开始日期
]
];
if($udate){
$range['udate'] = [
'gte' => $udate, // 大于等于开始日期
];
}
$query = [
'query' => [
'bool'=>[
... ... @@ -91,11 +79,18 @@ class Home extends Base {
['terms'=>[
'folder_id'=>$this->getFolderIds($this->getEmail('id'))
]],
['range'=>$range]
['range'=>['uuid' => [
'gte' => $last_id, // 大于等于开始日期
]]]
]
]
]
];
if($udate){
$query['query']['bool']['must'][] = ['range'=>['udate' => [
'gte' => $udate, // 大于等于开始日期
]]];
}
$lists = es()->search($query,0,$limit,[],false);
... ...