mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-16 14:00:56 +08:00
add global promotion deadline + fix grane medal
This commit is contained in:
@@ -5,7 +5,12 @@ namespace App\Models;
|
||||
|
||||
class TorrentState extends NexusModel
|
||||
{
|
||||
public $incrementing = false;
|
||||
protected $fillable = ['global_sp_state', 'deadline'];
|
||||
|
||||
protected $table = 'torrents_state';
|
||||
|
||||
public function getGlobalSpStateTextAttribute()
|
||||
{
|
||||
return Torrent::$promotionTypes[$this->global_sp_state]['text'] ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,11 @@ use Laravel\Sanctum\HasApiTokens;
|
||||
use Nexus\Database\NexusDB;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Models\Contracts\HasName;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser, HasName
|
||||
{
|
||||
use HasFactory, Notifiable, HasApiTokens;
|
||||
use HasFactory, Notifiable, HasApiTokens, HasRoles;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
@@ -476,7 +477,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
|
||||
public function canAccessAdmin(): bool
|
||||
{
|
||||
$targetClass = self::CLASS_SYSOP;
|
||||
$targetClass = Setting::get('authority.staffmem');
|
||||
if (!$this->class || $this->class < $targetClass) {
|
||||
do_log(sprintf('user: %s, no class or class < %s, can not access admin.', $this->id, $targetClass));
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user