|
@@ -68,6 +68,8 @@ class SubNoticeJobs implements ShouldQueue
|
|
|
$action_two = $this->send_violation_product($company_id, $statistics_start_time, $statistics_end_time);
|
|
$action_two = $this->send_violation_product($company_id, $statistics_start_time, $statistics_end_time);
|
|
|
$action_three = $this->send_violation_store($company_id, $statistics_start_time, $statistics_end_time);
|
|
$action_three = $this->send_violation_store($company_id, $statistics_start_time, $statistics_end_time);
|
|
|
if (empty($this->user_data)) return true;
|
|
if (empty($this->user_data)) return true;
|
|
|
|
|
+ $start_time = Carbon::today()->startOfDay()->getTimestamp(); // 今天开始时间 00:00:00
|
|
|
|
|
+ $end_time = Carbon::today()->endOfDay()->getTimestamp(); // 今天结束时间 23:59:59
|
|
|
$SubNoticeLogModel = new SubNoticeLogModel();
|
|
$SubNoticeLogModel = new SubNoticeLogModel();
|
|
|
if ($action_one && $action_two && $action_three) {
|
|
if ($action_one && $action_two && $action_three) {
|
|
|
foreach ($this->user_data as $key => $value) {
|
|
foreach ($this->user_data as $key => $value) {
|
|
@@ -113,6 +115,11 @@ class SubNoticeJobs implements ShouldQueue
|
|
|
'statistics_start_time' => $statistics_start_time,
|
|
'statistics_start_time' => $statistics_start_time,
|
|
|
'statistics_end_time' => $statistics_end_time,
|
|
'statistics_end_time' => $statistics_end_time,
|
|
|
];
|
|
];
|
|
|
|
|
+ // 校验今日是否已推送记录,防止重复添加
|
|
|
|
|
+ $exists = $SubNoticeLogModel->where([['insert_time','>=',$start_time], ['insert_time','<=',$end_time],['company_id','=',$company_id],['employee_id','=',$user_id]])->exists();
|
|
|
|
|
+ if ($exists) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
// 增加就订阅日志
|
|
// 增加就订阅日志
|
|
|
$insert_data = [
|
|
$insert_data = [
|
|
|
'company_id' => $company_id,
|
|
'company_id' => $company_id,
|