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

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

Return to bug 16913