作者 邓超

mailbody

... ... @@ -486,6 +486,42 @@ class MailListV2Es2 extends Base {
return $this->es->count($body);
}
/**
*
*/
public function search(){
$postid = app()->request('postid',0);
$email = app()->request('email');
$udate = app()->request('udate');
if(!is_numeric($udate)){
$udate = strtotime($udate);
}
$query = [
"bool"=>[
"must"=>[
["term"=>["postid"=>$postid]],
["term"=>["source"=>2]],
["term"=>["folder_as_int"=>1]],
["match_phrase"=>["from.email"=>$email]],
["range"=>["udate"=>['gte'=>$udate]]],
]
]
];
$result = $this->es->search(
['query'=>['constant_score'=>['filter'=>$query]]],
0,10,
['udate'=>"desc"],
50
);
$hits = $result['hits']['hits']??[];
return $hits;
}
}
... ...
... ... @@ -85,6 +85,9 @@ return [
// 解析 订阅url参数 数据
'desubscribe' => [\Controller\Home::class, 'desubscribe']
// fob流程服务用到的搜索
,'fob/ai/search' => [\Controller\fob_ai\MailListV2Es2::class,'search']
];
... ...