ソースを参照

[智价云] 城市为空预警更新

tangyuanwang 20 時間 前
コミット
1a8f4a1219
1 ファイル変更8 行追加11 行削除
  1. 8 11
      app/Jobs/Manager/Process/CityWarningNoticeJobs.php

+ 8 - 11
app/Jobs/Manager/Process/CityWarningNoticeJobs.php

@@ -81,19 +81,16 @@ class CityWarningNoticeJobs implements ShouldQueue
             })->where(function ($query) {
                 $query->orWhere('city_id', '0')->orWhere('city_name', '未知')->orWhere('city_name', '');
             })->where($map)->count();
+            if ($low_price_goods_count == 0 && $violation_product_count == 0 && $violation_store_count == 0) {
+                return true;
+            };
             //发送预警通知
             if ($low_price_goods_count > 0 || $violation_product_count > 0 || $violation_store_count > 0) {
-                $email_titl = "数据清洗-城市为空预警通知:\n";
-                $email_content = "数据查询时间:" . date('Y-m-d H:i:s', $start_time) . "-" . date('Y-m-d H:i:s', $end_time) . "\n";
-                if ($low_price_goods_count > 0) {
-                    $email_content .= "低价商品省份城市为空或者未知数据数量:" . $low_price_goods_count . "\n";
-                }
-                if ($violation_product_count > 0) {
-                    $email_content .= "禁止商品省份城市为空或者未知数据数量:" . $violation_product_count . "\n";
-                }
-                if ($violation_store_count > 0) {
-                    $email_content .= "违规店铺省份城市为空或者未知数据数量:" . $violation_store_count . "\n";
-                }
+                $email_titl = "数据清洗-城市为空预警通知";
+                $email_content = "数据查询时间:" . date('Y-m-d H:i:s', $start_time) . " - " . date('Y-m-d H:i:s', $end_time). 
+                " 低价商品省份城市为空或者未知数据数量:" . $low_price_goods_count.'条,'.
+                " 禁止商品省份城市为空或者未知数据数量:" . $violation_product_count.'条,'.
+                " 违规店铺省份城市为空或者未知数据数量:" . $violation_store_count.'条';
                 //发送预警通知
                 foreach ($email_notice_list as $email_notice) {
                     $message_data = [