refactor(admin): reuse filters hidden inputs partial in site subscriptions tools
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
@php
|
@php
|
||||||
/**
|
/**
|
||||||
* 统一输出“当前筛选上下文”的 hidden inputs。
|
* 统一输出“当前筛选上下文”的 hidden inputs。
|
||||||
* 用法:@include('admin.components.filters_hidden_inputs', ['filters' => $filters ?? []])
|
*
|
||||||
|
* 用法:
|
||||||
|
* @include('admin.components.filters_hidden_inputs', [
|
||||||
|
* 'filters' => $filters ?? [],
|
||||||
|
* // 可选:覆盖 keys(不同页面可复用,避免输出无关字段)
|
||||||
|
* // 'keys' => ['status', 'merchant_id', ...],
|
||||||
|
* ])
|
||||||
*/
|
*/
|
||||||
$filters = (array) ($filters ?? []);
|
$filters = (array) ($filters ?? []);
|
||||||
$keys = [
|
$keys = (array) ($keys ?? [
|
||||||
'status',
|
'status',
|
||||||
'payment_status',
|
'payment_status',
|
||||||
'merchant_id',
|
'merchant_id',
|
||||||
@@ -29,7 +35,7 @@
|
|||||||
'refund_inconsistent',
|
'refund_inconsistent',
|
||||||
'created_from',
|
'created_from',
|
||||||
'created_to',
|
'created_to',
|
||||||
];
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@foreach($keys as $k)
|
@foreach($keys as $k)
|
||||||
|
|||||||
@@ -386,13 +386,10 @@
|
|||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<form method="get" action="/admin/site-subscriptions/export" class="actions gap-10">
|
<form method="get" action="/admin/site-subscriptions/export" class="actions gap-10">
|
||||||
<input type="hidden" name="download" value="1">
|
<input type="hidden" name="download" value="1">
|
||||||
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
|
@include('admin.components.filters_hidden_inputs', [
|
||||||
<input type="hidden" name="merchant_id" value="{{ $filters['merchant_id'] ?? '' }}">
|
'filters' => $filters ?? [],
|
||||||
<input type="hidden" name="plan_id" value="{{ $filters['plan_id'] ?? '' }}">
|
'keys' => ['status', 'merchant_id', 'plan_id', 'expiry', 'ends_from', 'ends_to', 'keyword'],
|
||||||
<input type="hidden" name="expiry" value="{{ $filters['expiry'] ?? '' }}">
|
])
|
||||||
<input type="hidden" name="ends_from" value="{{ $filters['ends_from'] ?? '' }}">
|
|
||||||
<input type="hidden" name="ends_to" value="{{ $filters['ends_to'] ?? '' }}">
|
|
||||||
<input type="hidden" name="keyword" value="{{ $filters['keyword'] ?? '' }}">
|
|
||||||
<button class="btn btn-secondary btn-sm" type="submit">导出 CSV</button>
|
<button class="btn btn-secondary btn-sm" type="submit">导出 CSV</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -416,13 +413,10 @@
|
|||||||
@if($attachOrderId <= 0)
|
@if($attachOrderId <= 0)
|
||||||
<form method="post" action="/admin/site-subscriptions/batch-mark-expired" data-action="disable-on-submit" onsubmit="return confirm('确认将当前筛选集合内的订阅批量标记为已过期?该操作会更新 status 字段。');" class="actions gap-10">
|
<form method="post" action="/admin/site-subscriptions/batch-mark-expired" data-action="disable-on-submit" onsubmit="return confirm('确认将当前筛选集合内的订阅批量标记为已过期?该操作会更新 status 字段。');" class="actions gap-10">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
|
@include('admin.components.filters_hidden_inputs', [
|
||||||
<input type="hidden" name="merchant_id" value="{{ $filters['merchant_id'] ?? '' }}">
|
'filters' => $filters ?? [],
|
||||||
<input type="hidden" name="plan_id" value="{{ $filters['plan_id'] ?? '' }}">
|
'keys' => ['status', 'merchant_id', 'plan_id', 'expiry', 'ends_from', 'ends_to', 'keyword'],
|
||||||
<input type="hidden" name="expiry" value="{{ $filters['expiry'] ?? '' }}">
|
])
|
||||||
<input type="hidden" name="ends_from" value="{{ $filters['ends_from'] ?? '' }}">
|
|
||||||
<input type="hidden" name="ends_to" value="{{ $filters['ends_to'] ?? '' }}">
|
|
||||||
<input type="hidden" name="keyword" value="{{ $filters['keyword'] ?? '' }}">
|
|
||||||
|
|
||||||
<label class="muted form-inline-row">
|
<label class="muted form-inline-row">
|
||||||
<span>确认输入</span>
|
<span>确认输入</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user