Skip to content
Snippets Groups Projects
Commit 5303f1fd authored by Thomas Misilo's avatar Thomas Misilo Committed by Demian Katz
Browse files

Updated KohaILSDI to support getPurchaseHistory() (#723)

What it does is return the latest received issue from the Serials module in Koha
parent 4bd041b9
No related merge requests found
......@@ -1339,8 +1339,30 @@ class KohaILSDI extends \VuFind\ILS\Driver\AbstractBase implements
*/
public function getPurchaseHistory($id)
{
// TODO
return [];
try {
if (!$this->db) {
$this->initDb();
}
$sql = "SELECT b.title, b.biblionumber,
MAX(CONCAT(s.publisheddate, ' / ',s.serialseq))
AS 'date and enumeration'
FROM serial s
LEFT JOIN biblio b USING (biblionumber)
WHERE s.STATUS=2 and b.biblionumber = :id
GROUP BY b.biblionumber
ORDER BY s.publisheddate DESC";
$sqlStmt = $this->db->prepare($sql);
$sqlStmt->execute(['id' => $id]);
$result = [];
foreach ($sqlStmt->fetchAll() as $rowItem) {
$result[] = ['issue' => $rowItem["date and enumeration"]];
}
} catch (PDOException $e) {
throw new ILSException($e->getMessage());
}
return $result;
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment