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