Ken před 1 dnem
rodič
revize
5297e5a57d
1 změnil soubory, kde provedl 10 přidání a 4 odebrání
  1. 10 4
      app/Services/LotteryImageService.php

+ 10 - 4
app/Services/LotteryImageService.php

@@ -2,6 +2,8 @@
 
 namespace App\Services;
 
+use App\Models\Config;
+use Illuminate\Support\Facades\App;
 use Illuminate\Support\Facades\Storage;
 
 class LotteryImageService
@@ -18,7 +20,11 @@ class LotteryImageService
         $html = $this->buildHtml($records);
 
         // ========= 2. 保存HTML到临时文件 =========
-        $htmlPath = storage_path('app/lottery_temp.html');
+
+        $group_language = Config::where('field', 'group_language')->first()->val;
+
+        $htmlPath = storage_path("app/lottery_temp_{$group_language}.html");
+
         file_put_contents($htmlPath, $html);
 
         // ========= 3. 输出图片路径 =========
@@ -51,7 +57,7 @@ class LotteryImageService
      */
     protected function buildHtml($records): string
     {
-       
+
         $rows = '';
         foreach ($records as $row) {
             $rows .= '<tr>';
@@ -69,8 +75,8 @@ class LotteryImageService
             }
             $rows .= ' = ' . array_sum($row['winning_numbers']) . '</td>';
             $rows .= '<td>' . $row['combo'] . '</td>';
-            $rows .= '<td>'.$row['extreme'].'</td>';
-            $rows .= '<td>'.$row['tail'].'</td>';
+            $rows .= '<td>' . $row['extreme'] . '</td>';
+            $rows .= '<td>' . $row['tail'] . '</td>';
             $rows .= '</tr>';
         }