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');