data = $data; $this->output = new Output(); $this->id = isset($data['_job_id_']) ? $data['_job_id_'] : ''; $this->title = isset($data['_job_title_']) ? $data['_job_title_'] : ''; $this->output->newLine(); $this->output->writeln(" system task {$this->id} execution start"); $this->output->writeln('---------------------------------------------'); QueueService::status($this->id, self::STATUS_PROC, $this->statusDesc); if ($this->execute()) { $this->output->writeln('---------------------------------------------'); $this->output->info(" successful"); $this->status = self::STATUS_COMP; } else { $this->output->writeln('---------------------------------------------'); $this->output->error(" failure"); $this->status = self::STATUS_FAIL; } $job->delete(); QueueService::status($this->id, $this->status, $this->statusDesc); $this->output->writeln('---------------------------------------------'); $this->output->newLine(); } /** * 执行任务 * @return boolean */ protected function execute() { return true; } }