mirror of
https://github.com/v2board/v2board.git
synced 2025-01-26 16:09:09 +08:00
update: reset traffic
This commit is contained in:
parent
e9c79c1c08
commit
c60cd0a34a
@ -53,8 +53,8 @@ class ResetTraffic extends Command
|
|||||||
->toArray();
|
->toArray();
|
||||||
foreach ($resetMethods as $resetMethod) {
|
foreach ($resetMethods as $resetMethod) {
|
||||||
$planIds = explode(',', $resetMethod['plan_ids']);
|
$planIds = explode(',', $resetMethod['plan_ids']);
|
||||||
switch ($resetMethod['method']) {
|
switch (true) {
|
||||||
case null: {
|
case ($resetMethod['method'] === NULL): {
|
||||||
$resetTrafficMethod = config('v2board.reset_traffic_method', 0);
|
$resetTrafficMethod = config('v2board.reset_traffic_method', 0);
|
||||||
$builder = with(clone($this->builder))->whereIn('plan_id', $planIds);
|
$builder = with(clone($this->builder))->whereIn('plan_id', $planIds);
|
||||||
switch ((int)$resetTrafficMethod) {
|
switch ((int)$resetTrafficMethod) {
|
||||||
@ -72,17 +72,17 @@ class ResetTraffic extends Command
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0: {
|
case ($resetMethod['method'] === 0): {
|
||||||
$builder = with(clone($this->builder))->whereIn('plan_id', $planIds);
|
$builder = with(clone($this->builder))->whereIn('plan_id', $planIds);
|
||||||
$this->resetByMonthFirstDay($builder);
|
$this->resetByMonthFirstDay($builder);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: {
|
case ($resetMethod['method'] === 1): {
|
||||||
$builder = with(clone($this->builder))->whereIn('plan_id', $planIds);
|
$builder = with(clone($this->builder))->whereIn('plan_id', $planIds);
|
||||||
$this->resetByExpireDay($builder);
|
$this->resetByExpireDay($builder);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case ($resetMethod['method'] === 2): {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user