onQueue('server_log'); $this->u = $u; $this->d = $d; $this->userId = $userId; $this->server = $server; $this->protocol = $protocol; } /** * Execute the job. * * @return void */ public function handle() { $serverService = new ServerService(); if (!$serverService->log( $this->userId, $this->server->id, $this->u, $this->d, $this->server->rate, $this->protocol )) { throw new \Exception('日志记录失败'); } } }