update: package limit

This commit is contained in:
tokumeikoi
2022-08-02 16:37:42 +08:00
parent b0687b9dfd
commit 1c644e8c5f
7 changed files with 16 additions and 16 deletions

View File

@ -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;
}