refactor(platform-orders): created_at 快捷日期范围由 controller 注入
This commit is contained in:
@@ -411,9 +411,10 @@
|
||||
<input type="date" name="created_to" data-role="po-created-to" placeholder="创建时间到(YYYY-MM-DD)" value="{{ $filters['created_to'] ?? '' }}" class="w-180">
|
||||
@php
|
||||
// 运营提效:常用时间范围快捷入口(保持 query/back 安全口径;不依赖 JS)。
|
||||
$today = now()->format('Y-m-d');
|
||||
$from7d = now()->subDays(6)->format('Y-m-d');
|
||||
$from30d = now()->subDays(29)->format('Y-m-d');
|
||||
// 日期范围由 Controller 注入,避免 Blade 内多次 now() 调用跨天漂移。
|
||||
$today = (string) ($createdRangeToday ?? now()->format('Y-m-d'));
|
||||
$from7d = (string) ($createdRangeFrom7d ?? now()->subDays(6)->format('Y-m-d'));
|
||||
$from30d = (string) ($createdRangeFrom30d ?? now()->subDays(29)->format('Y-m-d'));
|
||||
|
||||
$createdRangeTodayUrl = $safeFullUrlWithQuery([
|
||||
'created_from' => $today,
|
||||
|
||||
Reference in New Issue
Block a user