改进 只计费动态计费实例
This commit is contained in:
parent
81ba72d85f
commit
ee4720fe2c
@ -36,14 +36,14 @@ public function __construct($minute, Host $host = null)
|
|||||||
*/
|
*/
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
if (! $this->host) {
|
if (!$this->host) {
|
||||||
$host = new Host();
|
$host = new Host();
|
||||||
|
|
||||||
if (app()->environment() != 'local') {
|
if (app()->environment() != 'local') {
|
||||||
$host = $host->where('minute_at', $this->minute);
|
$host = $host->where('minute_at', $this->minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
$host->whereIn('status', ['running', 'stopped'])->with('user')->chunk(500, function ($hosts) {
|
$host->whereIn('status', ['running', 'stopped'])->whereNull('billing_cycle')->with('user')->chunk(500, function ($hosts) {
|
||||||
foreach ($hosts as $host) {
|
foreach ($hosts as $host) {
|
||||||
dispatch(new self($this->minute, $host));
|
dispatch(new self($this->minute, $host));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user