# fetch cut_in_line and request_time since they're in the order_by
# and we're asking for distinct values
+ #
+ # KCLS JBAS-2005 Pull hold queue position from newly
+ # materialized reporter.hold_request_record grouping
+ # in targeted bib record.
select => {ahr => ['id', 'cut_in_line', 'request_time']},
from => 'ahr',
where => {
+ fulfillment_time => undef,
+ cancel_time => undef,
id => { in => {
- select => { ahcm => ['hold'] },
+ select => { rhrr => ['id'] },
from => {
- 'ahcm' => {
- 'ahcm2' => {
- 'class' => 'ahcm',
- 'field' => 'target_copy',
- 'fkey' => 'target_copy'
+ 'rhrr' => {
+ 'rhrr2' => {
+ 'class' => 'rhrr',
+ 'field' => 'bib_record',
+ 'fkey' => 'bib_record'
}
}
},
- where => { '+ahcm2' => { hold => $hold->id } },
+ where => { '+rhrr2' => { id => $hold->id } },
distinct => 1
}}
},