Commit 68ab6126 authored by SpinShare's avatar SpinShare

fixed multi-cardgive

parent 9bff6895
......@@ -80,7 +80,7 @@ class CardsController extends AbstractController
}
if($request->request->get('saveMulti') == "Give") {
$userIds = explode(",", $request->request->get('userId'));
$userIds = explode(",", $request->request->get('userIds'));
foreach($userIds as $userId) {
$user = $em->getRepository(User::class)->findOneBy(array('id' => $userId));
......@@ -94,6 +94,15 @@ class CardsController extends AbstractController
$newUserCard->setGivenDate(new \DateTime());
$em->persist($newUserCard);
$newNotification = new UserNotification();
$newNotification->setUser($user);
$newNotification->setNotificationType(3);
$newNotification->setNotificationData("");
$newNotification->setConnectedCard($newUserCard->getCard());
$newNotification->setConnectedUser($user);
$em->persist($newNotification);
$em->flush();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment