bug fix in remove documents
This commit is contained in:
parent
1cef78c6f5
commit
5893c5b196
|
|
@ -685,11 +685,15 @@ class HesabdariController extends AbstractController
|
|||
}
|
||||
if (!array_key_exists('code', $params))
|
||||
$this->createNotFoundException();
|
||||
// استفاده از متد ایمن برای پیدا کردن سند
|
||||
$doc = $provider->findHesabdariDocSafely($entityManager, [
|
||||
'code' => $params['code'],
|
||||
'bid' => $request->headers->get('activeBid')
|
||||
]);
|
||||
// استفاده از query builder برای پیدا کردن سند
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)
|
||||
->createQueryBuilder('h')
|
||||
->where('h.code = :code')
|
||||
->andWhere('h.bid = :bid')
|
||||
->setParameter('code', $params['code'])
|
||||
->setParameter('bid', $request->headers->get('activeBid'))
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
if (!$doc)
|
||||
throw $this->createNotFoundException();
|
||||
$roll = '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue