diff --git a/app/Console/Commands/ResetTraffic.php b/app/Console/Commands/ResetTraffic.php index cf248f74..7a441458 100644 --- a/app/Console/Commands/ResetTraffic.php +++ b/app/Console/Commands/ResetTraffic.php @@ -53,8 +53,8 @@ class ResetTraffic extends Command ->toArray(); foreach ($resetMethods as $resetMethod) { $planIds = explode(',', $resetMethod['plan_ids']); - switch ($resetMethod['method']) { - case null: { + switch (true) { + case ($resetMethod['method'] === NULL): { $resetTrafficMethod = config('v2board.reset_traffic_method', 0); $builder = with(clone($this->builder))->whereIn('plan_id', $planIds); switch ((int)$resetTrafficMethod) { @@ -72,17 +72,17 @@ class ResetTraffic extends Command } break; } - case 0: { + case ($resetMethod['method'] === 0): { $builder = with(clone($this->builder))->whereIn('plan_id', $planIds); $this->resetByMonthFirstDay($builder); break; } - case 1: { + case ($resetMethod['method'] === 1): { $builder = with(clone($this->builder))->whereIn('plan_id', $planIds); $this->resetByExpireDay($builder); break; } - case 2: { + case ($resetMethod['method'] === 2): { break; } }