View | Details | Raw Unified | Return to bug 16913
Collapse All | Expand All

(-)a/C4/Members.pm (-27 lines)
Lines 1964-1995 sub GetBorrowersWithIssuesHistoryOlderThan { Link Here
1964
    return \@results;
1964
    return \@results;
1965
}
1965
}
1966
1966
1967
=head2 GetBorrowersNamesAndLatestIssue
1968
1969
  $results = &GetBorrowersNamesAndLatestIssueList(@borrowernumbers)
1970
1971
this function get borrowers Names and surnames and Issue information.
1972
1973
I<@borrowernumbers> is an array which all elements are borrowernumbers.
1974
This hashref is containt the number of time this borrowers has borrowed before I<$date> and the borrowernumber.
1975
1976
=cut
1977
1978
sub GetBorrowersNamesAndLatestIssue {
1979
    my $dbh  = C4::Context->dbh;
1980
    my @borrowernumbers=@_;  
1981
    my $query = "
1982
       SELECT surname,lastname, phone, email,max(timestamp)
1983
       FROM borrowers 
1984
         LEFT JOIN issues ON borrowers.borrowernumber=issues.borrowernumber
1985
       GROUP BY borrowernumber
1986
   ";
1987
    my $sth = $dbh->prepare($query);
1988
    $sth->execute;
1989
    my $results = $sth->fetchall_arrayref({});
1990
    return $results;
1991
}
1992
1993
=head2 ModPrivacy
1967
=head2 ModPrivacy
1994
1968
1995
  my $success = ModPrivacy( $borrowernumber, $privacy );
1969
  my $success = ModPrivacy( $borrowernumber, $privacy );
1996
- 

Return to bug 16913