正在显示
1 个修改的文件
包含
20 行增加
和
3 行删除
| @@ -510,7 +510,7 @@ class RelayInquiry extends Command | @@ -510,7 +510,7 @@ class RelayInquiry extends Command | ||
| 510 | 510 | ||
| 511 | $pre = 0; | 511 | $pre = 0; |
| 512 | $start_time = time(); | 512 | $start_time = time(); |
| 513 | - $seconds = rand(300, 7200); // 开始时间 从5-2小时后开始 | 513 | + $seconds = $this->delay_seconds($form->inquiry_date); |
| 514 | $email = ''; | 514 | $email = ''; |
| 515 | if($is_inquiry) { | 515 | if($is_inquiry) { |
| 516 | $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); | 516 | $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); |
| @@ -573,7 +573,7 @@ class RelayInquiry extends Command | @@ -573,7 +573,7 @@ class RelayInquiry extends Command | ||
| 573 | $referrer = $this->getReferer($country_name, $lang); | 573 | $referrer = $this->getReferer($country_name, $lang); |
| 574 | 574 | ||
| 575 | $start_time = time(); | 575 | $start_time = time(); |
| 576 | - $seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始 | 576 | + $seconds = $this->delay_seconds($form->inquiry_date); |
| 577 | $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); | 577 | $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); |
| 578 | if($exists){ | 578 | if($exists){ |
| 579 | $this->output('转发站点邮件已存在'); | 579 | $this->output('转发站点邮件已存在'); |
| @@ -609,7 +609,7 @@ class RelayInquiry extends Command | @@ -609,7 +609,7 @@ class RelayInquiry extends Command | ||
| 609 | $user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua); | 609 | $user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua); |
| 610 | 610 | ||
| 611 | $start_time = time(); | 611 | $start_time = time(); |
| 612 | - $seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始 | 612 | + $seconds = $this->delay_seconds($form->inquiry_date); |
| 613 | $exists = ReInquiryDetail::where('re_website', $postid)->where('email', $form->email)->first(); | 613 | $exists = ReInquiryDetail::where('re_website', $postid)->where('email', $form->email)->first(); |
| 614 | if($exists){ | 614 | if($exists){ |
| 615 | $this->output('转发站点邮件已存在'); | 615 | $this->output('转发站点邮件已存在'); |
| @@ -935,6 +935,23 @@ class RelayInquiry extends Command | @@ -935,6 +935,23 @@ class RelayInquiry extends Command | ||
| 935 | } | 935 | } |
| 936 | 936 | ||
| 937 | /** | 937 | /** |
| 938 | + * @author zbj | ||
| 939 | + * @date 2025/7/16 | ||
| 940 | + */ | ||
| 941 | + public function delay_seconds($inquiry_date) | ||
| 942 | + { | ||
| 943 | + $seconds = rand(300, 2 * 3600); // 默认 从5分钟-2小时后开始 | ||
| 944 | + $time_diff = time() - strtotime($inquiry_date); //2小时前-24小时内的 当天发完 | ||
| 945 | + if ($time_diff > 2 * 3600 && $time_diff < 24 * 3600) { | ||
| 946 | + $seconds = rand(2 * 3600, 8 * 3600); | ||
| 947 | + } | ||
| 948 | + if ($time_diff < 24 * 3600) { //24小时前的 2天内发完 | ||
| 949 | + $seconds = rand(2 * 3600, 48 * 3600); | ||
| 950 | + } | ||
| 951 | + return $seconds; | ||
| 952 | + } | ||
| 953 | + | ||
| 954 | + /** | ||
| 938 | * @return \Psr\Log\LoggerInterface | 955 | * @return \Psr\Log\LoggerInterface |
| 939 | */ | 956 | */ |
| 940 | public function logChannel() | 957 | public function logChannel() |
-
请 注册 或 登录 后发表评论