mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update: fix
This commit is contained in:
		| @@ -43,11 +43,11 @@ class PlanController extends Controller | ||||
|             ->get(); | ||||
|         if (isset($counts)) { | ||||
|             foreach ($plans as $k => $v) { | ||||
|                 if (isset($counts[$plans[$k]->id])) { | ||||
|                 if ($plans[$k]->capacity_limit === NULL) continue; | ||||
|                 if (!isset($counts[$plans[$k]->id])) continue; | ||||
|                 $plans[$k]->capacity_limit = $plans[$k]->capacity_limit - $counts[$plans[$k]->id]->count; | ||||
|             } | ||||
|         } | ||||
|         } | ||||
|         return response([ | ||||
|             'data' => $plans | ||||
|         ]); | ||||
|   | ||||
| @@ -16,7 +16,7 @@ class PlanService | ||||
|  | ||||
|     public function haveCapacity(): bool | ||||
|     { | ||||
|         if ($this->plan->capacity_limit === 0) return true; | ||||
|         if ($this->plan->capacity_limit === NULL) return true; | ||||
|         $count = User::where('plan_id', $this->plan->plan_id)->count(); | ||||
|         return $this->plan->capacity_limit - $count; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user