From af1a98e1a11d10090e97539b9065d31feaf68c8a Mon Sep 17 00:00:00 2001 From: chenxi Date: Tue, 29 Sep 2026 17:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E6=9C=88?= =?UTF-8?q?=E5=8A=A0=E6=9D=83=E5=B9=B3=E5=9D=87=E5=8D=95=E4=BB=B7=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=A9=BA=E7=99=BD=EF=BC=9A=E5=AF=BC=E5=87=BA=E5=90=8C?= =?UTF-8?q?=E6=A0=B7=E6=8A=8A=20Y-m=20=E5=BD=92=E4=B8=80=E4=B8=BA=E5=BD=93?= =?UTF-8?q?=E6=9C=881=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Business/Pages.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php index c0eb6a5f..cbd7c8f8 100644 --- a/app/Http/Controllers/Business/Pages.php +++ b/app/Http/Controllers/Business/Pages.php @@ -494,6 +494,10 @@ class Pages extends Controller ->where('status', 'computed')->orderByDesc('report_month')->pluck('report_month') ->map(static fn ($month): string => substr((string) $month, 0, 10))->all(); $requested = substr(trim((string) $request->query('month', '')), 0, 10); + if (preg_match('/^\d{4}-\d{2}$/', $requested) === 1) { + // 导出时筛选栏提交的也是 Y-m,同样补成当月 1 号。 + $requested .= '-01'; + } $month = $requested !== '' ? $requested : ($months[0] ?? null); $query = DB::connection($connection)->table('product_monthly_weighted_average_rows');