mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
unify sub category sort
This commit is contained in:
@@ -78,8 +78,8 @@ class CategoryResource extends Resource
|
||||
,
|
||||
Forms\Components\TextInput::make('sort_index')
|
||||
->default(0)
|
||||
->label(__('label.search_box.taxonomy.sort_index'))
|
||||
->helperText(__('label.search_box.taxonomy.sort_index_help'))
|
||||
->label(__('label.priority'))
|
||||
->helperText(__('label.priority_help'))
|
||||
,
|
||||
|
||||
]);
|
||||
@@ -97,7 +97,7 @@ class CategoryResource extends Resource
|
||||
Tables\Columns\TextColumn::make('class_name')->label(__('label.search_box.taxonomy.class_name')),
|
||||
Tables\Columns\TextColumn::make('sort_index')->label(__('label.search_box.taxonomy.sort_index'))->sortable(),
|
||||
])
|
||||
->defaultSort('sort_index', 'asc')
|
||||
->defaultSort('sort_index', 'desc')
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('mode')
|
||||
->options(SearchBox::query()->pluck('name', 'id')->toArray())
|
||||
|
||||
@@ -32,8 +32,8 @@ class CodecResource extends Resource
|
||||
Forms\Components\TextInput::make('name')->required()->label(__('label.search_box.taxonomy.name'))->required(),
|
||||
Forms\Components\TextInput::make('sort_index')
|
||||
->default(0)
|
||||
->label(__('label.search_box.taxonomy.sort_index'))
|
||||
->helperText(__('label.search_box.taxonomy.sort_index_help'))
|
||||
->label(__('label.priority'))
|
||||
->helperText(__('label.priority_help'))
|
||||
,
|
||||
Forms\Components\Select::make('mode')
|
||||
->options(SearchBox::query()->pluck('name', 'id')->toArray())
|
||||
@@ -55,7 +55,7 @@ class CodecResource extends Resource
|
||||
Tables\Columns\TextColumn::make('name')->label(__('label.search_box.taxonomy.name'))->searchable(),
|
||||
Tables\Columns\TextColumn::make('sort_index')->label(__('label.search_box.taxonomy.sort_index'))->sortable(),
|
||||
])
|
||||
->defaultSort('sort_index', 'asc')
|
||||
->defaultSort('sort_index', 'desc')
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('mode')
|
||||
->options(SearchBox::query()->pluck('name', 'id')->toArray())
|
||||
|
||||
@@ -176,7 +176,7 @@ class SearchBoxRepository extends BaseRepository
|
||||
$select .= sprintf('<option value="%s">%s</option>', 0, nexus_trans('nexus.select_one_please'));
|
||||
$list = NexusDB::table($table)->where(function (Builder $query) use ($searchBox) {
|
||||
return $query->where('mode', $searchBox->id)->orWhere('mode', 0);
|
||||
})->get();
|
||||
})->orderBy('sort_index', 'desc')->get();
|
||||
foreach ($list as $item) {
|
||||
$selected = '';
|
||||
if (isset($torrentInfo[$torrentField]) && $torrentInfo[$torrentField] == $item->id) {
|
||||
|
||||
Reference in New Issue
Block a user