From 3b19d14e778e52c823e36c01d5e4562e61ed00a9 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 14 Jun 2010 16:24:55 +0000 Subject: [PATCH] Make the estimated hold queue position method aware of the cut_in_line field git-svn-id: svn://svn.open-ils.org/ILS/trunk@16711 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 1cf8756a9..6d0f20ab0 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1029,14 +1029,24 @@ sub retrieve_hold_queue_status_impl { # accomodate holds that currently have no potential copies my $q_holds = $e->json_query({ - # fetch request_time since it's in the order_by and we're asking for distinct values - select => {ahr => ['id', 'request_time']}, + # fetch cut_in_line and request_time since they're in the order_by + # and we're asking for distinct values + select => {ahr => ['id', 'cut_in_line', 'request_time']}, from => { ahr => { ahcm => {type => 'left'} # there may be no copy maps } }, - order_by => {ahr => ['request_time']}, + order_by => [ + { + "class" => "ahr", + "field" => "cut_in_line", + "transform" => "coalesce", + "params" => [ 0 ], + "direction" => "desc" + }, + { "class" => "ahr", "field" => "request_time" } + ], distinct => 1, where => { '-or' => [ -- 2.11.0