Lines 299-308
sub calculate {
Link Here
|
299 |
|
299 |
|
300 |
# Processing average loanperiods |
300 |
# Processing average loanperiods |
301 |
$strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID"; |
301 |
$strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID"; |
302 |
$strcalc .= ", itemcallnumber as CALLNUM"; |
302 |
$strcalc .= ", GROUP_CONCAT(DISTINCT itemcallnumber) as CALLNUM"; |
303 |
$strcalc .= ", ccode as CCODE"; |
303 |
$strcalc .= ", GROUP_CONCAT(DISTINCT ccode) as CCODE"; |
304 |
$strcalc .= ", location as LOC"; |
304 |
$strcalc .= ", GROUP_CONCAT(DISTINCT location) as LOC"; |
305 |
$strcalc .= " , $colfield " if ($colfield); |
305 |
$strcalc .= " , GROUP_CONCAT(DISTINCT $colfield) " if ($colfield); |
306 |
$strcalc .= " FROM `old_issues` |
306 |
$strcalc .= " FROM `old_issues` |
307 |
LEFT JOIN items USING(itemnumber) |
307 |
LEFT JOIN items USING(itemnumber) |
308 |
LEFT JOIN biblio USING(biblionumber) |
308 |
LEFT JOIN biblio USING(biblionumber) |
Lines 344-350
sub calculate {
Link Here
|
344 |
@$filters[12]=~ s/\*/%/g if (@$filters[12]); |
344 |
@$filters[12]=~ s/\*/%/g if (@$filters[12]); |
345 |
$strcalc .= " AND year(old_issues.issuedate) like '" . @$filters[12] ."'" if ( @$filters[12] ); |
345 |
$strcalc .= " AND year(old_issues.issuedate) like '" . @$filters[12] ."'" if ( @$filters[12] ); |
346 |
|
346 |
|
347 |
$strcalc .= " group by biblio.biblionumber"; |
347 |
$strcalc .= " group by biblio.biblionumber,biblio.title"; |
348 |
$strcalc .= ", $colfield" if ($column); |
348 |
$strcalc .= ", $colfield" if ($column); |
349 |
$strcalc .= " order by `RANK` DESC"; |
349 |
$strcalc .= " order by `RANK` DESC"; |
350 |
$strcalc .= ", $colfield " if ($colfield); |
350 |
$strcalc .= ", $colfield " if ($colfield); |
351 |
- |
|
|