From 8f0ca2ceb7403451dbf46c1bd8f9c7c03c51b7ad Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 5 Nov 2004 10:10:48 +0000 Subject: [PATCH] Limit search to 30 days when the order is by acquisition date desc (ie when the user want to see new books) --- C4/SearchMarc.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index e93267656f..d9f1ce8d1a 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -259,6 +259,7 @@ 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 ) <30" if $orderby =~ "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"); -- 2.39.5