mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
H&R add create time filter and bulk delete
This commit is contained in:
@@ -70,11 +70,32 @@ class HitAndRunResource extends Resource
|
|||||||
->label('UID')
|
->label('UID')
|
||||||
->placeholder('UID')
|
->placeholder('UID')
|
||||||
,
|
,
|
||||||
])->query(function (Builder $query, array $data) {
|
])
|
||||||
|
->query(function (Builder $query, array $data) {
|
||||||
return $query->when($data['uid'], fn (Builder $query, $uid) => $query->where("uid", $uid));
|
return $query->when($data['uid'], fn (Builder $query, $uid) => $query->where("uid", $uid));
|
||||||
})
|
})
|
||||||
,
|
,
|
||||||
Tables\Filters\SelectFilter::make('status')->options(HitAndRun::listStatus(true))->label(__('label.status')),
|
Tables\Filters\SelectFilter::make('status')->options(HitAndRun::listStatus(true))->label(__('label.status')),
|
||||||
|
Tables\Filters\Filter::make('created_at_begin')
|
||||||
|
->form([
|
||||||
|
Forms\Components\DatePicker::make('created_at_begin')
|
||||||
|
->maxDate(now())
|
||||||
|
->label(__('hr.created_at_begin'))
|
||||||
|
,
|
||||||
|
])->query(function (Builder $query, array $data) {
|
||||||
|
return $query->when($data['created_at_begin'], fn (Builder $query, $value) => $query->where("created_at", '>=', $value));
|
||||||
|
})
|
||||||
|
,
|
||||||
|
Tables\Filters\Filter::make('created_at_end')
|
||||||
|
->form([
|
||||||
|
Forms\Components\DatePicker::make('created_at_end')
|
||||||
|
->maxDate(now())
|
||||||
|
->label(__('hr.created_at_end'))
|
||||||
|
,
|
||||||
|
])->query(function (Builder $query, array $data) {
|
||||||
|
return $query->when($data['created_at_end'], fn (Builder $query, $value) => $query->where("created_at", '<=', $value));
|
||||||
|
})
|
||||||
|
,
|
||||||
])
|
])
|
||||||
->actions([
|
->actions([
|
||||||
Tables\Actions\ViewAction::make(),
|
Tables\Actions\ViewAction::make(),
|
||||||
@@ -88,6 +109,8 @@ class HitAndRunResource extends Resource
|
|||||||
->deselectRecordsAfterCompletion()
|
->deselectRecordsAfterCompletion()
|
||||||
->label(__('admin.resources.hit_and_run.bulk_action_pardon'))
|
->label(__('admin.resources.hit_and_run.bulk_action_pardon'))
|
||||||
->icon('heroicon-o-x-mark')
|
->icon('heroicon-o-x-mark')
|
||||||
|
,
|
||||||
|
Tables\Actions\DeleteBulkAction::make('bulkDelete')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.0');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.0');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-03-29');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-04-05');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ return [
|
|||||||
'client' => 'Client',
|
'client' => 'Client',
|
||||||
'reason' => 'Reason',
|
'reason' => 'Reason',
|
||||||
'change' => 'Change',
|
'change' => 'Change',
|
||||||
|
'created_at_begin' => 'Created at begin',
|
||||||
|
'created_at_end' => 'Created at end',
|
||||||
'setting' => [
|
'setting' => [
|
||||||
'nav_text' => 'Setting',
|
'nav_text' => 'Setting',
|
||||||
'backup' => [
|
'backup' => [
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ return [
|
|||||||
'reason' => '原因',
|
'reason' => '原因',
|
||||||
'change' => '修改',
|
'change' => '修改',
|
||||||
'create' => '创建',
|
'create' => '创建',
|
||||||
|
'created_at_begin' => '创建时间开始',
|
||||||
|
'created_at_end' => '创建时间结束',
|
||||||
'setting' => [
|
'setting' => [
|
||||||
'nav_text' => '设置',
|
'nav_text' => '设置',
|
||||||
'backup' => [
|
'backup' => [
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ return [
|
|||||||
'client' => '客戶端',
|
'client' => '客戶端',
|
||||||
'reason' => '原因',
|
'reason' => '原因',
|
||||||
'change' => '修改',
|
'change' => '修改',
|
||||||
|
'created_at_begin' => '創建時間開始',
|
||||||
|
'created_at_end' => '創建時間結束',
|
||||||
'setting' => [
|
'setting' => [
|
||||||
'nav_text' => '設置',
|
'nav_text' => '設置',
|
||||||
'backup' => [
|
'backup' => [
|
||||||
|
|||||||
Reference in New Issue
Block a user