user = UserModel::find($this->media->uid); $answer = AnswerModel::whereRaw($this->media->field_primary)->first(); if ($answer) { switch ($this->media->result) { case MediaSecure::MANUAL_SUGGESTION_BLOCK: $this->handleFailed($answer); break; case MediaSecure::MANUAL_SUGGESTION_PASS: $this->handleSuccess($answer); break; } } } public function handleFailed($answer) { $answer->delete(); $this->notification(); } /** * 通知 */ public function notification() { $payload = [ 'to_user' => $this->user->getAuth(), 'user' => $this->user->toArray(), 'meta' => [ 'field' => '问答内容', 'handle' => '已被删除', ], ]; dispatch(new RegistEventJob(100015, $payload))->onQueue("{push}"); } public function handleSuccess($answer) { } }