作者 邓超

同步es异常

... ... @@ -184,7 +184,7 @@ class SyncToEsCmd {
* @time 2025/8/5 14:53
*/
private function getPostids($email_id){
$postids = $this->fob_db->throw()->cache(1800)->all("select `post_id` from `e_mail_binds` where `source` = 1 and `email_id` = {$email_id} and `deleted_at` is null");
$postids = $this->fob_db->throw()->cache(1800)->all("select `post_id` from `e_mail_binds` where `source` = 1 and `email_id` = {$email_id}");
if($postids){
return array_column($postids,'post_id');
... ... @@ -403,9 +403,18 @@ class SyncToEsCmd {
//每60秒验证一次
if(redis()->add('fob_bind_mail_times_check:'.$email_id,1,60)){
$lastpostid = $this->fob_db->throw()->value("select `post_id` from `e_mail_binds_log` where `source` = 2 and `email_id` = '{$email_id}' order by `id` desc limit 1");
// 如果找不到了
$thelast = $this->fob_db->throw()->first("select * from `e_mail_binds` where `source` = 2 and `email_id` = '{$email_id}' and `deleted_at` is null order by `id` desc limit 1");
if(!$thelast){
return [0,0];
$his = $this->fob_db->throw()->first("select `email` from `e_mail_binds` where `source` = 2 and `email_id` = '{$email_id}' limit 1");
if(!$his){
return [0,0];
}
// 归公
$thelast['post_id'] = 0;
$thelast['source'] = 2;
$thelast['email'] = $his['email'];
$thelast['email_id'] = $email_id;
}
$thelastpostid = $thelast['post_id'];
... ...