我在这里遇到一个问题。样品会自己说话。
Queue::after(function (JobProcessed $event) {
$job_details = json_decode($event->job->getRawBody(), true);
)});
这就是 $job_details 的样子:
'displayName' => 'App\\Jobs\\CommandJob',
'job' => 'Illuminate\\Queue\\CallQueuedHandler@call',
'maxTries' => 10,
'timeout' => NULL,
'data' =>
array (
'commandName' => 'App\\Jobs\\CommandJob',
'command' => 'O:19:"App\\Jobs\\CommandJob":9:{s:32:"' . "\0" . 'App\\Jobs\\CommandJob' . "\0" . 'commandName";N;s:30:"' . "\0" . 'App\\Jobs\\CommandJob' . "\0" . 'arguments";N;s:28:"' . "\0" . 'App\\Jobs\\CommandJob' . "\0" . 'command";s:20:"google:get-campaigns";s:5:"tries";i:10;s:32:"' . "\0" . 'App\\Jobs\\CommandJob' . "\0" . 'nextCommand";a:1:{i:0;s:19:"google:get-adgroups";}s:6:"' . "\0" . '*' . "\0" . 'job";N;s:10:"connection";N;s:5:"queue";s:11:"update_data";s:5:"delay";N;}',
我想从 $job_details['data']['command'] 获取一些参数。有没有一些简单的方法可以做到这一点,或者我需要一些自制的灵魂?