refactor(site-subscriptions): ends_at 快捷日期范围由 controller 注入
This commit is contained in:
@@ -276,9 +276,10 @@
|
||||
<input type="date" name="ends_from" data-role="sub-ends-from" placeholder="到期时间从" value="{{ $filters['ends_from'] ?? '' }}" class="w-180">
|
||||
<div class="muted muted-xs mt-6">
|
||||
@php
|
||||
$endsToday = now()->format('Y-m-d');
|
||||
$ends7d = now()->addDays(7)->format('Y-m-d');
|
||||
$ends30d = now()->addDays(30)->format('Y-m-d');
|
||||
// 到期区间快捷入口:日期范围由 Controller 注入,避免 Blade 内多次 now() 调用导致跨天漂移。
|
||||
$endsToday = (string) ($endsRangeToday ?? now()->format('Y-m-d'));
|
||||
$ends7d = (string) ($endsRange7d ?? now()->addDays(7)->format('Y-m-d'));
|
||||
$ends30d = (string) ($endsRange30d ?? now()->addDays(30)->format('Y-m-d'));
|
||||
|
||||
// 到期区间快捷入口:应保留当前筛选上下文(status/expiry/merchant/plan/keyword/back),仅覆盖 ends_from/ends_to,并清空 page。
|
||||
$endsQuickTodayUrl = $safeFullUrlWithQuery(['ends_from' => $endsToday, 'ends_to' => $endsToday, 'page' => null]);
|
||||
|
||||
Reference in New Issue
Block a user