v2board/app/Services/UserService.php

24 lines
421 B
PHP
Raw Normal View History

2020-02-28 01:12:55 +08:00
<?php
namespace App\Services;
use App\Models\User;
class UserService
{
public $user;
public function __construct(User $user)
{
$this->user = $user;
}
public function isAvailable()
{
2020-02-28 16:21:16 +08:00
if ($this->user->enable && $this->user->transfer_enable && ($this->user->expired_at > time() || $this->user->expired_at == 0)) {
2020-02-28 01:12:55 +08:00
return true;
}
return false;
}
}