mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
filament create&edit redirect
This commit is contained in:
@@ -146,7 +146,7 @@ class SearchBox extends NexusModel
|
||||
$table = self::$taxonomies[$torrentField]['table'];
|
||||
return NexusDB::table($table)->where(function (Builder $query) use ($searchBox) {
|
||||
return $query->where('mode', $searchBox->id)->orWhere('mode', 0);
|
||||
})->get();
|
||||
})->orderBy('sort_index')->orderBy('id')->get();
|
||||
}
|
||||
|
||||
public static function listModeOptions(): array
|
||||
@@ -174,17 +174,27 @@ class SearchBox extends NexusModel
|
||||
}
|
||||
}
|
||||
|
||||
public static function isSpecialEnabled(): bool
|
||||
{
|
||||
return Setting::get('main.spsct') == 'yes';
|
||||
}
|
||||
|
||||
public static function getBrowseMode()
|
||||
{
|
||||
return Setting::get('main.browsecat');
|
||||
}
|
||||
|
||||
public static function getSpecialMode()
|
||||
{
|
||||
return Setting::get('main.specialcat');
|
||||
}
|
||||
|
||||
|
||||
public function categories(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(Category::class, 'mode');
|
||||
}
|
||||
|
||||
public function normal_fields(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(SearchBoxField::class, 'searchbox_id');
|
||||
}
|
||||
|
||||
public function taxonomy_source(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(Source::class, 'mode');
|
||||
@@ -220,10 +230,5 @@ class SearchBox extends NexusModel
|
||||
return $this->hasMany(Processing::class, 'mode');
|
||||
}
|
||||
|
||||
public function taxonomies(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(Taxonomy::class, 'mode');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class SearchBoxField extends NexusModel
|
||||
{
|
||||
protected $table = 'searchbox_fields';
|
||||
|
||||
protected $fillable = ['searchbox_id', 'field_type', 'field_id', ];
|
||||
|
||||
const FIELD_TYPE_SOURCE = 'source';
|
||||
const FIELD_TYPE_MEDIUM = 'medium';
|
||||
const FIELD_TYPE_CODEC = 'codec';
|
||||
const FIELD_TYPE_AUDIO_CODEC = 'audio_codec';
|
||||
const FIELD_TYPE_STANDARD = 'standard';
|
||||
const FIELD_TYPE_PROCESSING = 'processing';
|
||||
const FIELD_TYPE_TEAM = 'team';
|
||||
const FIELD_TYPE_CUSTOM = 'custom';
|
||||
|
||||
public static $fieldTypes = [
|
||||
self::FIELD_TYPE_SOURCE => ['text' => 'Source', 'model' => Source::class],
|
||||
self::FIELD_TYPE_MEDIUM => ['text' => 'Medium', 'model' => Media::class],
|
||||
self::FIELD_TYPE_CODEC => ['text' => 'Codec', 'model' => Codec::class],
|
||||
self::FIELD_TYPE_AUDIO_CODEC => ['text' => 'Audio codec', 'model' => AudioCodec::class],
|
||||
self::FIELD_TYPE_STANDARD => ['text' => 'Standard', 'model' => Standard::class],
|
||||
self::FIELD_TYPE_PROCESSING => ['text' => 'Processing', 'model' => Processing::class],
|
||||
self::FIELD_TYPE_TEAM => ['text' => 'Team', 'model' => Team::class],
|
||||
self::FIELD_TYPE_CUSTOM => ['text' => 'Custom', ],
|
||||
];
|
||||
|
||||
|
||||
public function searchBox(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SearchBox::class, 'searchbox_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user