From 2f9a6f934efe6e4f38c20123d99597c9423a7d47 Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 11 Feb 2006 15:49:03 +0000 Subject: [PATCH] added sort order on SELECTs so that selection_depth is used to fill "closer" holds first git-svn-id: svn://svn.open-ils.org/ILS/trunk@3030 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/Publisher/action.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 4ae2f1c53a..f2bf6e9695 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -63,7 +63,7 @@ sub nearest_hold { WHERE h.pickup_lib = ? AND hm.target_copy = ? AND h.capture_time IS NULL - ORDER BY h.pickup_lib - (SELECT home_ou FROM actor.usr a WHERE a.id = h.usr), h.request_time + ORDER BY h.selection_depth DESC, h.pickup_lib - (SELECT home_ou FROM actor.usr a WHERE a.id = h.usr), h.request_time LIMIT 1 SQL return $id; @@ -414,12 +414,12 @@ sub new_hold_copy_targeter { fulfillment_time => undef, prev_check_time => { '<=' => $expire_threshold }, }, - { order_by => 'request_time,prev_check_time' } ) ]; + { order_by => 'selection_depth DESC, request_time,prev_check_time' } ) ]; push @$holds, action::hold_request->search( capture_time => undef, fulfillment_time => undef, prev_check_time => undef, - { order_by => 'request_time' } ); + { order_by => 'selection_depth DESC, request_time' } ); } } catch Error with { my $e = shift; -- 2.43.2