liugc 1 ano atrás
pai
commit
92ff5d697b
2 arquivos alterados com 7 adições e 6 exclusões
  1. 6 5
      app/common/command/SendBxMail.php
  2. 1 1
      extend/excel/ExcelWriter.php

+ 6 - 5
app/common/command/SendBxMail.php

@@ -58,11 +58,12 @@ class SendBxMail extends Command
             $mail->CharSet = 'UTF-8';
             // 发送者和接收者设置
             $mail->setFrom('whkyjl@126.com', '武汉开源节流科技有限公司');     // 发件人邮箱和名称
-            $mail->addAddress('sujing@ub.chinalife-p.com.cn', '出单业务'); // 收件人邮箱和名称
-            $mail->addAddress('649478907@qq.com', '出单业务'); // 收件人邮箱和名称
-            $mail->addAddress('liliangjie@ub.chinalife-p.com.cn', '出单业务'); // 收件人邮箱和名称
-            $mail->addAddress('fangxuhao@outlook.com', '出单业务'); // 收件人邮箱和名称
+//            $mail->addAddress('sujing@ub.chinalife-p.com.cn', '出单业务'); // 收件人邮箱和名称
+//            $mail->addAddress('649478907@qq.com', '出单业务'); // 收件人邮箱和名称
+//            $mail->addAddress('liliangjie@ub.chinalife-p.com.cn', '出单业务'); // 收件人邮箱和名称
+//            $mail->addAddress('fangxuhao@outlook.com', '出单业务'); // 收件人邮箱和名称
 //            $mail->addAddress('1804628603@qq.com', '出单业务'); // 收件人邮箱和名称
+            $mail->addAddress('466014217@qq.com', '出单业务'); // 收件人邮箱和名称
 
             // 设置邮件内容
             $mail->isHTML(true);                                        // 将邮件正文设置为HTML格式
@@ -94,7 +95,7 @@ class SendBxMail extends Command
             }else{
                 $sheet->savePath = './public/exports/';
                 $sheet->generateExcelFile($fields['zh_cn_fields'], $lists,$filename, $fields['data_fields']);
-                return [$sheet->fileUrl(),$filename];
+                return [$sheet->fileUrl(),$filename.'.xlsx'];
             }
         } catch (\Exception $e) {
             Log::info('ServiceWorkMail:'."生成职业责任险投保清单失败. 错误信息: {$e->getMessage()}");

+ 1 - 1
extend/excel/ExcelWriter.php

@@ -42,7 +42,7 @@ class ExcelWriter
         $filePath = $savePath . $filename;
         $writer = new Xlsx($this->spreadsheet);
         $writer->save($filePath);
-        $this->fileUrl = "/exports/". $filename;
+        $this->fileUrl = ($this->savePath?:"/exports/"). $filename;
     }
     public function fileUrl()
     {