$uid, 'invite_uid' => $to_uid, ]); foreach ($questions as $question) { LogModel::create([ 'uid' => $uid, 'tuid' => $to_uid, 'do' => 3, 'attach' => [$question], ]); } FriendApplyModel::send($uid, $to_uid); dispatch_now(new FriendInvitationReportJob($invitationCard, $questions)); DB::commit(); return true; } catch (\Exception $exception) { DB::rollBack(); return false; } } public function agree(int $uid, int $apply_uid) { if ($uid == $apply_uid) { throw new AlertException("参数错误", 422); } $applyOrFriend = FriendModel::applyOrFriend($uid, $apply_uid); if (1 == $applyOrFriend) { } else { throw new AlertException("没有收到新未处理的好友申请", 423); } } }