Browse Source

[智价云] 内容信息更新

tangyuanwang 15 hours ago
parent
commit
50c57c77de
1 changed files with 13 additions and 3 deletions
  1. 13 3
      app/Jobs/Manager/Process/SubNoticeJobs.php

+ 13 - 3
app/Jobs/Manager/Process/SubNoticeJobs.php

@@ -71,6 +71,7 @@ class SubNoticeJobs implements ShouldQueue
                 foreach ($this->user_data as $key => $value) {
                     $mobile = $value['mobile'];
                     $email_to = $value['email'];
+                    $user_id = $key;
                     $number1 = isset($this->user_data[$key]['lowprice_product_logids']) ? count($this->user_data[$key]['lowprice_product_logids']) : 0;
                     $number2 = isset($this->user_data[$key]['violation_product_logids']) ? count($this->user_data[$key]['violation_product_logids']) : 0;
                     $number3 = isset($this->user_data[$key]['violation_store_logids']) ? count($this->user_data[$key]['violation_store_logids']) : 0;
@@ -82,14 +83,23 @@ class SubNoticeJobs implements ShouldQueue
                         // $res_msg = Sms::sendContent($mobile, ['totle_number' => $totle_number, 'number1' => $number1, 'number2' => $number2, 'number3' => $number3], $sms_tpl_id);
                         // Log::info('job_send_sms', '订阅短信通知推送队列记录', ['email' => $mobile, 'sms_tpl_id' => $sms_tpl_id, 'msg' => $res_msg]);
                     }
+                    $header_date = '';
+                    $statistics_start_time_string = date('Y-m-d', strtotime($statistics_start_time));
+                    $statistics_end_time_string = date('Y-m-d', strtotime($statistics_end_time));
+                    if ($statistics_start_time_string == $statistics_end_time_string) {
+                        $header_date = $statistics_start_time;
+                    } else {
+                        $header_date = $statistics_start_time_string. '至'. $statistics_end_time_string;
+                    }
                     $email_title ='';
                     $email_content = '';
                     if (trim($email_to) != '') {
                         $email_title = '智价云违规数据通知提醒';
-                        $email_content = "智价云提醒:本次采集总数据共" . $totle_number . "条,其中低价挂网商品共" . $number1 . "条、禁止挂网商品共" . $number2 . "条、违规挂网店铺共" . $number3 . "条。";
+                        $email_content = "智价云提醒:".$header_date."采集总数据共" . $totle_number . "条,其中低价挂网商品共" . $number1 . "条、禁止挂网商品共" . $number2 . "条、违规挂网店铺共" . $number3 . "条。";
                         // $res_msg = $EmailVerifyCode->sendSmtpEmail($email_to, $email_title, $email_content);
                         // Log::info('job_send_email', '订阅邮件通知推送队列记录', ['email' => $email_to, 'email_content' => $email_content, 'msg' => $res_msg]);
                     }
+                    $internal_notice_content = $header_date."采集总数据共" . $totle_number . "条,其中低价挂网商品共" . $number1 . "条、禁止挂网商品共" . $number2 . "条、违规挂网店铺共" . $number3 . "条。";
                     $ext_data = [
                         'company_id' => $company_id,
                         'lowprice_product_number' => $number1,
@@ -101,6 +111,8 @@ class SubNoticeJobs implements ShouldQueue
                     // 增加就订阅日志
                     $insert_data = [
                         'company_id' => $company_id,
+                        'employee_id' => $user_id,
+                        'internal_notice_content' => $internal_notice_content,
                         'email' => $email_to,
                         'mobile' => $mobile,
                         'email_content' => trim($email_to) != '' ? json_encode(['title' => $email_title, 'content' => $email_content]): '',
@@ -113,8 +125,6 @@ class SubNoticeJobs implements ShouldQueue
                 }
             }
         } catch (\Exception $e) {
-            print_r($e->getMessage());
-            exit;
             Log::info('job_error', '订阅短信通知推送队列失败', ['data' => $this->message_data, 'error' => $e->getMessage()]);
         }
     }