Bug 8223 - Properly format SQL query in C4::Bookseller::GetBookSeller
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
parent
cc02d468c3
commit
9dc42e9ec4
|
|
@ -63,9 +63,12 @@ aqbooksellers table in the Koha database.
|
|||
sub GetBookSeller {
|
||||
my $searchstring = shift;
|
||||
$searchstring = q{%} . $searchstring . q{%};
|
||||
my $query =
|
||||
'select aqbooksellers.*, count(*) as basketcount from aqbooksellers left join aqbasket '
|
||||
. 'on aqbasket.booksellerid = aqbooksellers.id where name like ? group by aqbooksellers.id order by name';
|
||||
my $query = "
|
||||
SELECT aqbooksellers.*, count(*) AS basketcount
|
||||
FROM aqbooksellers
|
||||
LEFT JOIN aqbasket ON aqbasket.booksellerid = aqbooksellers.id
|
||||
WHERE name LIKE ? GROUP BY aqbooksellers.id ORDER BY name
|
||||
";
|
||||
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare($query);
|
||||
|
|
|
|||
Loading…
Reference in New Issue