update: reset traffic

This commit is contained in:
tokumeikoi 2022-03-05 13:37:49 +08:00
parent e9c79c1c08
commit c60cd0a34a

View File

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