mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
modal show global
This commit is contained in:
@@ -24,6 +24,7 @@ class BonusLogs extends NexusModel
|
||||
const BUSINESS_TYPE_GIFT_TO_SOMEONE = 10;
|
||||
const BUSINESS_TYPE_NO_AD = 11;
|
||||
const BUSINESS_TYPE_GIFT_TO_LOW_SHARE_RATIO = 12;
|
||||
const BUSINESS_TYPE_LUCKY_DRAW = 13;
|
||||
|
||||
public static array $businessTypes = [
|
||||
self::BUSINESS_TYPE_CANCEL_HIT_AND_RUN => ['text' => 'Cancel H&R'],
|
||||
@@ -38,6 +39,7 @@ class BonusLogs extends NexusModel
|
||||
self::BUSINESS_TYPE_GIFT_TO_SOMEONE => ['text' => 'Gift to someone'],
|
||||
self::BUSINESS_TYPE_NO_AD => ['text' => 'No ad'],
|
||||
self::BUSINESS_TYPE_GIFT_TO_LOW_SHARE_RATIO => ['text' => 'Gift to low share ratio'],
|
||||
self::BUSINESS_TYPE_LUCKY_DRAW => ['text' => 'Lucky draw'],
|
||||
];
|
||||
|
||||
public static function getBonusForCancelHitAndRun()
|
||||
|
||||
@@ -23,7 +23,7 @@ class NexusModel extends Model
|
||||
*/
|
||||
protected function serializeDate(\DateTimeInterface $date)
|
||||
{
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i');
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -135,7 +135,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
*/
|
||||
protected function serializeDate(\DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i');
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
protected $fillable = [
|
||||
'username', 'email', 'passhash', 'secret', 'stylesheet', 'editsecret', 'added', 'modcomment', 'enabled', 'status',
|
||||
'leechwarn', 'leechwarnuntil', 'page', 'class', 'uploaded', 'downloaded', 'clientselect', 'showclienterror', 'last_home',
|
||||
'seedbonus', 'bonuscomment', 'downloadpos', 'vip_added', 'vip_until', 'title',
|
||||
'seedbonus', 'bonuscomment', 'downloadpos', 'vip_added', 'vip_until', 'title', 'invites', 'attendance_card',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -439,6 +439,16 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
return $this->hasMany(PollAnswer::class, 'userid');
|
||||
}
|
||||
|
||||
public function metas()
|
||||
{
|
||||
return $this->hasMany(UserMeta::class, 'uid');
|
||||
}
|
||||
|
||||
public function usernameChangeLogs()
|
||||
{
|
||||
return $this->hasMany(UsernameChangeLog::class, 'uid');
|
||||
}
|
||||
|
||||
public function getAvatarAttribute($value)
|
||||
{
|
||||
if ($value) {
|
||||
|
||||
30
app/Models/UserMeta.php
Normal file
30
app/Models/UserMeta.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class UserMeta extends NexusModel
|
||||
{
|
||||
protected $fillable = ['uid', 'meta_key', 'meta_value', 'status', 'deadline'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
const STATUS_NORMAL = 0;
|
||||
|
||||
|
||||
const META_KEY_PERSONALIZED_USERNAME = 'PERSONALIZED_USERNAME';
|
||||
|
||||
const META_KEY_CHANGE_USERNAME = 'CHANGE_USERNAME';
|
||||
|
||||
protected $appends = ['meta_key_text'];
|
||||
|
||||
public function getMetaKeyTextAttribute()
|
||||
{
|
||||
return nexus_trans('label.user_meta.meta_keys.' . $this->meta_key) ?? '';
|
||||
}
|
||||
|
||||
public static function consumeBenefit($uid, $metaKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
16
app/Models/UsernameChangeLog.php
Normal file
16
app/Models/UsernameChangeLog.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class UsernameChangeLog extends NexusModel
|
||||
{
|
||||
protected $fillable = ['uid', 'username_old', 'username_new', ];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'uid');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user