mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
fixed attachment statistics for sqlite (#847)
Co-authored-by: jona <a@b.c>
This commit is contained in:
parent
d0937218b9
commit
edf50a71d1
1 changed files with 8 additions and 8 deletions
|
@ -58,8 +58,8 @@ class AttachmentRepository extends DBElementRepository
|
|||
{
|
||||
$qb = $this->createQueryBuilder('attachment');
|
||||
$qb->select('COUNT(attachment)')
|
||||
->where('attachment.path LIKE :like');
|
||||
$qb->setParameter('like', '\\%SECURE\\%%');
|
||||
->where('attachment.path LIKE :like ESCAPE \'#\'');
|
||||
$qb->setParameter('like', '#%SECURE#%%');
|
||||
$query = $qb->getQuery();
|
||||
|
||||
return (int) $query->getSingleScalarResult();
|
||||
|
@ -94,12 +94,12 @@ class AttachmentRepository extends DBElementRepository
|
|||
{
|
||||
$qb = $this->createQueryBuilder('attachment');
|
||||
$qb->select('COUNT(attachment)')
|
||||
->where('attachment.path LIKE :base')
|
||||
->orWhere('attachment.path LIKE :media')
|
||||
->orWhere('attachment.path LIKE :secure');
|
||||
$qb->setParameter('secure', '\\%SECURE\\%%');
|
||||
$qb->setParameter('base', '\\%BASE\\%%');
|
||||
$qb->setParameter('media', '\\%MEDIA\\%%');
|
||||
->where('attachment.path LIKE :base ESCAPE \'#\'')
|
||||
->orWhere('attachment.path LIKE :media ESCAPE \'#\'')
|
||||
->orWhere('attachment.path LIKE :secure ESCAPE \'#\'');
|
||||
$qb->setParameter('secure', '#%SECURE#%%');
|
||||
$qb->setParameter('base', '#%BASE#%%');
|
||||
$qb->setParameter('media', '#%MEDIA#%%');
|
||||
$query = $qb->getQuery();
|
||||
|
||||
return (int) $query->getSingleScalarResult();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue