deal($data)) { Log::info(json_encode($data)); $job->delete(); return true; } Log::error(json_encode($data)); if ($job->attempts() >= 3) { $job->delete(); return false; } $job->release(10); //10秒后重试 } /** * 处理业务逻辑 * @param type $data * @return bool */ public function deal($data): bool { $type = $data["type"]; switch ($type) { case 1: //通知单位审核注册 $enterprise = $data["info"]; //企业信息 $msg["createTime"] = date("Y-m-d H:i:s"); $sender = new ChuanglanSmsApi(); $sender->sendSMS($mobile, $msg); case 2: break; } return false; } }