onQueue('batch_traffic_fetch'); $this->server = $server; $this->data = $data; $this->protocol = $protocol; $this->timestamp = $timestamp; $this->childServer = $childServer; } public function handle(): void { $targetServer = $this->childServer ?? $this->server; foreach ($this->data as $uid => $v) { User::where('id', $uid) ->incrementEach( [ 'u' => $v[0] * $targetServer['rate'], 'd' => $v[1] * $targetServer['rate'], ], ['t' => time()] ); } } }