|
|
@@ -37,25 +37,27 @@ class SubNotice extends Controller
|
|
|
foreach ($result as $key => $item) {
|
|
|
|
|
|
//查询低价商品清洗清洗情况
|
|
|
- $action1 = $ExecuteLogModel->query()->where([['code', '=', 'LowPriceGoodsJobs'],['company_id', '=', $item['id']], ['status', '=', '0'], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
+ $action1 = $ExecuteLogModel->query()->where([['code', '=', 'LowPriceGoodsJobs'], ['company_id', '=', $item['id']], ['status', '=', '0'], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
if ($action1 < 1) continue;
|
|
|
//查询违规产品清洗清洗情况
|
|
|
- $action2 = $ExecuteLogModel->query()->where([['code', '=', 'ViolationProductJobs'],['company_id', '=', $item['id']], ['status', '=', '0'], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
+ $action2 = $ExecuteLogModel->query()->where([['code', '=', 'ViolationProductJobs'], ['company_id', '=', $item['id']], ['status', '=', '0'], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
if ($action2 < 1) continue;
|
|
|
//查询违规门店清洗清洗情况
|
|
|
- $action3 = $ExecuteLogModel->query()->where([['code', '=', 'ViolationStoreJobs'],['company_id', '=', $item['id']], ['status', '=', '0'], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
+ $action3 = $ExecuteLogModel->query()->where([['code', '=', 'ViolationStoreJobs'], ['company_id', '=', $item['id']], ['status', '=', '0'], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
if ($action3 < 1) continue;
|
|
|
// 准备数据
|
|
|
$message_data = ['company_id' => $item['id']];
|
|
|
- //执行发送通知任务
|
|
|
- SendNoticeJobs::dispatch($message_data);
|
|
|
- // SendNoticeJobs::dispatchSync($message_data);
|
|
|
+
|
|
|
//如果今日存在通知推送记录,则跳过统计
|
|
|
$sub_notice_count = $SubNoticeLogModel->query()->where([['company_id', '=', $item['id']], ['insert_time', '>=', $todayStart], ['insert_time', '<=', $todayEnd]])->count();
|
|
|
- if ($sub_notice_count > 0) continue;
|
|
|
-
|
|
|
- SubNoticeJobs::dispatch($message_data);
|
|
|
- // SubNoticeJobs::dispatchSync($message_data);
|
|
|
+ if ($sub_notice_count > 0) {
|
|
|
+ //执行发送通知任务
|
|
|
+ // SendNoticeJobs::dispatch($message_data);
|
|
|
+ SendNoticeJobs::dispatchSync($message_data);
|
|
|
+ } else {
|
|
|
+ // SubNoticeJobs::dispatch($message_data);
|
|
|
+ SubNoticeJobs::dispatchSync($message_data);
|
|
|
+ }
|
|
|
}
|
|
|
// 告知结果
|
|
|
return 6;
|