From 9257971835563866fa67821554cd2740087671ad Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 23 Sep 2005 09:45:09 +0000 Subject: [PATCH] fixing bug for recent acquisitions. Now works well. --- C4/SearchMarc.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index c5e76efbfb..f3c4ee22c0 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -278,7 +278,9 @@ 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 .= "and TO_DAYS( NOW( ) ) - TO_DAYS( biblio.timestamp ) <300" if $orderby =~ "biblio.timestamp"; + $sql_where1 .= "and TO_DAYS( NOW( ) ) - TO_DAYS( marc_biblio.datecreated ) <$desc_or_asc" if $orderby =~ "biblio.timestamp"; + $desc_or_asc="DESC" if $orderby="biblio.timestamp"; +# $offset=0 if $orderby eq "biblio.timestamp"; my $sth; if ($sql_where2) { $sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,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"); -- 2.39.5