修复商品月加权平均单价导出空白:导出同样把 Y-m 归一为当月1日
This commit is contained in:
parent
a412fcb12f
commit
af1a98e1a1
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user