mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-20 21:36:04 +08:00
32 lines
613 B
PHP
32 lines
613 B
PHP
<?php
|
|
|
|
namespace Convoy\Console\Commands\Server;
|
|
|
|
use Convoy\Models\Server;
|
|
use Illuminate\Console\Command;
|
|
|
|
class ResetUsagesCommand extends Command
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $description = 'Reset the bandwidth usage of all servers on the first of each month.';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $signature = 'c:server:reset-usages';
|
|
|
|
/**
|
|
* Handle command execution.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
if (date('d') === '01') {
|
|
Server::query()->update([
|
|
'bandwidth_usage' => 0,
|
|
]);
|
|
}
|
|
}
|
|
}
|