|
|
@@ -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>';
|
|
|
}
|
|
|
|