Merge remote-tracking branch 'origin/master' into akun
正在显示
5 个修改的文件
包含
75 行增加
和
11 行删除
| @@ -10,6 +10,7 @@ namespace App\Console\Commands\Inquiry; | @@ -10,6 +10,7 @@ namespace App\Console\Commands\Inquiry; | ||
| 10 | use App\Helper\Common; | 10 | use App\Helper\Common; |
| 11 | use App\Helper\Gpt; | 11 | use App\Helper\Gpt; |
| 12 | use App\Helper\Translate; | 12 | use App\Helper\Translate; |
| 13 | +use App\Helper\Validate; | ||
| 13 | use App\Models\Ai\AiCommand; | 14 | use App\Models\Ai\AiCommand; |
| 14 | use App\Models\Inquiry\ReInquiryConfig; | 15 | use App\Models\Inquiry\ReInquiryConfig; |
| 15 | use App\Models\Inquiry\ReInquiryDetail; | 16 | use App\Models\Inquiry\ReInquiryDetail; |
| @@ -329,7 +330,10 @@ class RelayInquiry extends Command | @@ -329,7 +330,10 @@ class RelayInquiry extends Command | ||
| 329 | $val->save(); | 330 | $val->save(); |
| 330 | continue; | 331 | continue; |
| 331 | } | 332 | } |
| 332 | - | 333 | + //验证手机号 无效 号码不推送 |
| 334 | + if(!Validate::phone($val->phone)){ | ||
| 335 | + $val->phone = ''; | ||
| 336 | + } | ||
| 333 | try { | 337 | try { |
| 334 | $res = false; | 338 | $res = false; |
| 335 | foreach ($ad_task as $task){ | 339 | foreach ($ad_task as $task){ |
| @@ -357,10 +361,10 @@ class RelayInquiry extends Command | @@ -357,10 +361,10 @@ class RelayInquiry extends Command | ||
| 357 | //FB询盘的全局过滤规则 | 361 | //FB询盘的全局过滤规则 |
| 358 | $fb_config = ReInquiryConfig::getDefaultConfigCache(ReInquiryConfig::TYPE_FILTER_WORDS); | 362 | $fb_config = ReInquiryConfig::getDefaultConfigCache(ReInquiryConfig::TYPE_FILTER_WORDS); |
| 359 | 363 | ||
| 360 | - $fb_config['filter_contents'] = array_filter(explode("\r\n", $fb_config['filter_contents']?:'')); | ||
| 361 | - $fb_config['filter_emails'] = array_filter(explode("\r\n", $fb_config['filter_emails']?:'')); | ||
| 362 | - $fb_config['filter_mobiles'] = array_filter(explode("\r\n", $fb_config['filter_mobiles']?:'')); | ||
| 363 | - $fb_config['filter_names'] = array_filter(explode("\r\n", $fb_config['filter_names']?:'')); | 364 | + $fb_config['filter_contents'] = array_filter(explode("\r\n", $fb_config['filter_contents']??'')); |
| 365 | + $fb_config['filter_emails'] = array_filter(explode("\r\n", $fb_config['filter_emails']??'')); | ||
| 366 | + $fb_config['filter_mobiles'] = array_filter(explode("\r\n", $fb_config['filter_mobiles']??'')); | ||
| 367 | + $fb_config['filter_names'] = array_filter(explode("\r\n", $fb_config['filter_names']??'')); | ||
| 364 | 368 | ||
| 365 | $config['filter_contents'] = array_unique(array_merge($fb_config['filter_contents'],$config['filter_contents'])); | 369 | $config['filter_contents'] = array_unique(array_merge($fb_config['filter_contents'],$config['filter_contents'])); |
| 366 | $config['filter_emails'] = array_unique(array_merge($fb_config['filter_emails'],$config['filter_emails'])); | 370 | $config['filter_emails'] = array_unique(array_merge($fb_config['filter_emails'],$config['filter_emails'])); |
| @@ -382,6 +386,10 @@ class RelayInquiry extends Command | @@ -382,6 +386,10 @@ class RelayInquiry extends Command | ||
| 382 | return '过滤邮箱:' . $filter_email; | 386 | return '过滤邮箱:' . $filter_email; |
| 383 | } | 387 | } |
| 384 | } | 388 | } |
| 389 | + //邮箱有效性 | ||
| 390 | + if(!Validate::email($data['email'])){ | ||
| 391 | + return '邮箱无效'; | ||
| 392 | + } | ||
| 385 | } | 393 | } |
| 386 | //过滤电话 | 394 | //过滤电话 |
| 387 | if(!empty($data['phone']) && !empty($config['filter_mobiles'])){ | 395 | if(!empty($data['phone']) && !empty($config['filter_mobiles'])){ |
| @@ -225,7 +225,7 @@ class DownloadProject extends Command | @@ -225,7 +225,7 @@ class DownloadProject extends Command | ||
| 225 | foreach ($data['inquiry_country'] as $k => $v){ | 225 | foreach ($data['inquiry_country'] as $k => $v){ |
| 226 | $country .= $k.'、'; | 226 | $country .= $k.'、'; |
| 227 | }; | 227 | }; |
| 228 | - trim($country,'、'); | 228 | + $country = trim($country,'、'); |
| 229 | $content1 = '询盘主要来源于'.$country.'等国家地区'; | 229 | $content1 = '询盘主要来源于'.$country.'等国家地区'; |
| 230 | } | 230 | } |
| 231 | $content1 .= '如有高质量客户,请您密切关注与跟进;'; | 231 | $content1 .= '如有高质量客户,请您密切关注与跟进;'; |
| @@ -306,7 +306,7 @@ class DownloadProject extends Command | @@ -306,7 +306,7 @@ class DownloadProject extends Command | ||
| 306 | } | 306 | } |
| 307 | $arr[] = $content4; | 307 | $arr[] = $content4; |
| 308 | foreach ($arr as $key => $val){ | 308 | foreach ($arr as $key => $val){ |
| 309 | - $content .= $key.','.$val; | 309 | + $content .= ($key+1).','.$val; |
| 310 | } | 310 | } |
| 311 | $timestamp = strtotime('tomorrow 9:00 AM'); | 311 | $timestamp = strtotime('tomorrow 9:00 AM'); |
| 312 | $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp); | 312 | $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp); |
| @@ -156,7 +156,7 @@ class WeekProject extends Command | @@ -156,7 +156,7 @@ class WeekProject extends Command | ||
| 156 | foreach ($data['inquiry_country'] as $k => $v){ | 156 | foreach ($data['inquiry_country'] as $k => $v){ |
| 157 | $country .= $k.'、'; | 157 | $country .= $k.'、'; |
| 158 | }; | 158 | }; |
| 159 | - trim($country,'、'); | 159 | + $country = trim($country,'、'); |
| 160 | $content1 .= '询盘主要来源于'.$country.'等国家地区'; | 160 | $content1 .= '询盘主要来源于'.$country.'等国家地区'; |
| 161 | } | 161 | } |
| 162 | $content1 .= '如有高质量客户,请您密切关注与跟进;'; | 162 | $content1 .= '如有高质量客户,请您密切关注与跟进;'; |
| @@ -245,12 +245,13 @@ class WeekProject extends Command | @@ -245,12 +245,13 @@ class WeekProject extends Command | ||
| 245 | 'project_id'=>$project_id, | 245 | 'project_id'=>$project_id, |
| 246 | 'friend_id'=>$friend_id, | 246 | 'friend_id'=>$friend_id, |
| 247 | 'type'=>MessagePush::TYPE_WEEK, | 247 | 'type'=>MessagePush::TYPE_WEEK, |
| 248 | - 'content'=>$content, | 248 | + 'content'=>'【全球搜V6.0周报】'.$content, |
| 249 | 'ref_ids'=>'', | 249 | 'ref_ids'=>'', |
| 250 | 'send_time'=>$tomorrowNineAM | 250 | 'send_time'=>$tomorrowNineAM |
| 251 | ]; | 251 | ]; |
| 252 | //写入一条推送消息 自动消费 | 252 | //写入一条推送消息 自动消费 |
| 253 | $messagePushModel = new MessagePush(); | 253 | $messagePushModel = new MessagePush(); |
| 254 | - $messagePushModel->add($param); | 254 | + echo date('Y-m-d H:i:s') . '生成推送消息:'.$project_id . PHP_EOL; |
| 255 | + return $messagePushModel->add($param); | ||
| 255 | } | 256 | } |
| 256 | } | 257 | } |
app/Helper/Validate.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +namespace App\Helper; | ||
| 5 | + | ||
| 6 | +use App\Utils\HttpUtils; | ||
| 7 | +use GuzzleHttp\Exception\GuzzleException; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * Class Validate | ||
| 12 | + * @package App\Helper | ||
| 13 | + * @author zbj | ||
| 14 | + * @date 2025/2/27 | ||
| 15 | + */ | ||
| 16 | +class Validate | ||
| 17 | +{ | ||
| 18 | + /** | ||
| 19 | + * 邮箱有效性 | ||
| 20 | + * @param $email | ||
| 21 | + * @return bool | ||
| 22 | + * @author zbj | ||
| 23 | + * @date 2025/2/27 | ||
| 24 | + */ | ||
| 25 | + public static function email($email) | ||
| 26 | + { | ||
| 27 | + try { | ||
| 28 | + $res = HttpUtils::get('https://fob.ai.cc/api/check_email', ['email' => $email]); | ||
| 29 | + $res = Arr::s2a($res); | ||
| 30 | + $status = $res['data']['status'] ?? 0; | ||
| 31 | + } catch (\Exception | GuzzleException $e) { | ||
| 32 | + $status = 0; | ||
| 33 | + } | ||
| 34 | + return !($status == 4); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 邮箱有效性 | ||
| 39 | + * @param $email | ||
| 40 | + * @return bool | ||
| 41 | + * @author zbj | ||
| 42 | + * @date 2025/2/27 | ||
| 43 | + */ | ||
| 44 | + public static function phone($email) | ||
| 45 | + { | ||
| 46 | + try { | ||
| 47 | + $res = HttpUtils::get('https://fob.ai.cc/api/check_phone', ['phone' => $email]); | ||
| 48 | + $res = Arr::s2a($res); | ||
| 49 | + $status = $res['data']['valid_status'] ?? 0; | ||
| 50 | + } catch (\Exception | GuzzleException $e) { | ||
| 51 | + $status = 0; | ||
| 52 | + } | ||
| 53 | + return !($status == 2); | ||
| 54 | + } | ||
| 55 | +} |
| @@ -25,7 +25,7 @@ class WebSettingTextLogic extends BaseLogic | @@ -25,7 +25,7 @@ class WebSettingTextLogic extends BaseLogic | ||
| 25 | */ | 25 | */ |
| 26 | public function setting_read(){ | 26 | public function setting_read(){ |
| 27 | $web_setting = new WebSetting(); | 27 | $web_setting = new WebSetting(); |
| 28 | - $setting_info = $web_setting->read(['project_id'=>$this->user['project_id']],['anchor_setting','anchor_is_enable','anchor_num','anchor_page_num']); | 28 | + $setting_info = $web_setting->read(['project_id'=>$this->user['project_id']],['anchor_setting','anchor_is_enable','anchor_keyword_is_enable','anchor_num','anchor_page_num']); |
| 29 | if($setting_info === false){ | 29 | if($setting_info === false){ |
| 30 | $setting_info = []; | 30 | $setting_info = []; |
| 31 | } | 31 | } |
-
请 注册 或 登录 后发表评论