mirror of
https://github.com/v2board/v2board.git
synced 2025-06-16 06:37:53 +08:00
update: package limit
This commit is contained in:
@ -18,7 +18,8 @@ class PlanService
|
||||
public function haveCapacity(): bool
|
||||
{
|
||||
if ($this->plan->capacity_limit === NULL) return true;
|
||||
$count = User::where('plan_id', $this->plan->plan_id)->count();
|
||||
$count = self::countActiveUsers();
|
||||
$count = $count[$this->plan->plan_id];
|
||||
return ($this->plan->capacity_limit - $count) > 0;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@ class UserService
|
||||
{
|
||||
if ($user->expired_at <= time() || $user->expired_at === NULL) return null;
|
||||
// if reset method is not reset
|
||||
if (!isset($user->plan->reset_traffic_method)) return null;
|
||||
if ($user->plan->reset_traffic_method === 2) return null;
|
||||
switch (true) {
|
||||
case ($user->plan->reset_traffic_method === NULL): {
|
||||
|
Reference in New Issue
Block a user