From 09aec48554f4ad04c50bb29740dc7beda34b12f8 Mon Sep 17 00:00:00 2001 From: genjimoto Date: Fri, 3 Jun 2005 03:58:26 +0000 Subject: [PATCH] Added necessary tables for search for availablity feature into Catalogsearch. Someone needs to speed it up somehow. --- C4/SearchMarc.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index dd10f9e0f6..ffc80711bc 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -276,15 +276,15 @@ sub catalogsearch { # Finds the basic results without the NOT requests my ($sql_tables, $sql_where1, $sql_where2) = create_request($dbh,\@normal_tags, \@normal_and_or, \@normal_operator, \@normal_value); - $sql_where1 .=" ". $sqlstring; + $sql_where1 .= $sqlstring; $sql_where1 .= "and TO_DAYS( NOW( ) ) - TO_DAYS( biblio.timestamp ) <30" if $orderby =~ "biblio.timestamp"; my $sth; if ($sql_where2) { - $sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,items,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby $desc_or_asc"); - warn "Q2 : select distinct m1.bibid from biblio,biblioitems,items,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby $desc_or_asc term is @$value"; + $sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,items,issues,reserves,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby $desc_or_asc"); + warn "Q2 : select distinct m1.bibid from biblio,biblioitems,items,issues,reserves,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby $desc_or_asc term is @$value"; } else { - $sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,items,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby $desc_or_asc"); - warn "Q : select distinct m1.bibid from biblio,biblioitems,items,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby $desc_or_asc"; + $sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,items,issues,reserves,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby $desc_or_asc"); + warn "Q : select distinct m1.bibid from biblio,biblioitems,items,issues,reserves,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby $desc_or_asc"; } $sth->execute(); my @result = (); -- 2.39.5