正在显示
1 个修改的文件
包含
12 行增加
和
7 行删除
@@ -28,8 +28,13 @@ class AutoMail { | @@ -28,8 +28,13 @@ class AutoMail { | ||
28 | 28 | ||
29 | redis()->set('prev_auto_mail_keyword',$filter,86400); | 29 | redis()->set('prev_auto_mail_keyword',$filter,86400); |
30 | 30 | ||
31 | - $q = array_diff($filter,$old); | ||
32 | - // 差集 | 31 | + $t = function ($vs){ |
32 | + return array_map(function ($v){ | ||
33 | + return $v[0].":".$v[1]; | ||
34 | + },$vs); | ||
35 | + }; | ||
36 | + // 找到新增的 | ||
37 | + $q = array_diff($t($filter),$t($old)); | ||
33 | if(!$q){ | 38 | if(!$q){ |
34 | return 0; | 39 | return 0; |
35 | } | 40 | } |
@@ -38,7 +43,7 @@ class AutoMail { | @@ -38,7 +43,7 @@ class AutoMail { | ||
38 | 43 | ||
39 | $not_must = []; | 44 | $not_must = []; |
40 | foreach ($q as $f){ | 45 | foreach ($q as $f){ |
41 | - list($t,$str) = $f; | 46 | + list($t,$str) = explode(':',$f,2); |
42 | if($t==2){ | 47 | if($t==2){ |
43 | $not_must[] = ["match_phrase"=>["subject"=>$str]]; | 48 | $not_must[] = ["match_phrase"=>["subject"=>$str]]; |
44 | 49 | ||
@@ -78,10 +83,10 @@ class AutoMail { | @@ -78,10 +83,10 @@ class AutoMail { | ||
78 | foreach ($lists['hits']['hits']??[] as $list){ | 83 | foreach ($lists['hits']['hits']??[] as $list){ |
79 | $list = $list['_source']; | 84 | $list = $list['_source']; |
80 | $id = intval($list['uuid']??0); | 85 | $id = intval($list['uuid']??0); |
81 | - if($id && isAiAutoMail($list['from']['email'],$list['subject'])){ | ||
82 | - _echo("id = ".$id); | ||
83 | - redis()->rPush('sync_to_es',$id); | ||
84 | - } | 86 | + if($id && isAiAutoMail($list['from']['email'],$list['subject'])){ |
87 | + _echo("id = ".$id); | ||
88 | + redis()->rPush('sync_to_es',$id); | ||
89 | + } | ||
85 | } | 90 | } |
86 | 91 | ||
87 | } | 92 | } |
-
请 注册 或 登录 后发表评论