mirror of
https://github.com/v2board/v2board.git
synced 2025-07-27 18:38:47 +08:00
add onetime plan
This commit is contained in:
@ -14,6 +14,7 @@ class ServerService
|
||||
$query->where('expired_at', '>=', time())
|
||||
->orWhere('expired_at', 0);
|
||||
})
|
||||
->where('enable', 1)
|
||||
->select([
|
||||
'id',
|
||||
'email',
|
||||
|
23
app/Services/UserService.php
Normal file
23
app/Services/UserService.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class UserService
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function isAvailable()
|
||||
{
|
||||
if ($this->user->transfer_enable && ($this->user->expired_at > time() || $this->user->expired_at == 0)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user