test = $test; parent::__construct(['test_id' => $test->id]); } /** * 执行任务 * * @return bool */ public function run(): bool { // 任务处理逻辑 return true; } /** * 获取任务数据 * * @return array */ public function payload() { return [ 'test_id' => $this->test->id, 'test_data' => $this->test->toArray() ]; } }