Skip to content

Commit

Permalink
LIMS-1390: Fix searching of data collection groups (#833)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Williams <[email protected]>
  • Loading branch information
ndg63276 and Mark Williams authored Oct 1, 2024
1 parent edb2fca commit 98b6d45
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions api/src/Page/DC.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,14 @@ function _data_collections($single = null)
$s = str_replace('_', '$_', $this->arg('s'));

$st = sizeof($args) + 1;
$where .= " AND (lower(dc.filetemplate) LIKE lower(CONCAT(CONCAT('%',:$st),'%')) ESCAPE '$' OR lower(dc.imagedirectory) LIKE lower(CONCAT(CONCAT('%',:" . ($st + 1) . "), '%')) ESCAPE '$' OR lower(smp.name) LIKE lower(CONCAT(CONCAT('%', :" . ($st + 2) . "), '%')) ESCAPE '$')";
$where2 .= " AND (lower(es.comments) LIKE lower(CONCAT(CONCAT('%',:" . ($st + 3) . "), '%')) ESCAPE '$' OR lower(es.element) LIKE lower(CONCAT(CONCAT('%',:" . ($st + 4) . "), '%')) ESCAPE '$' OR lower(smp.name) LIKE lower(CONCAT(CONCAT('%',:" . ($st + 5) . "), '%')) ESCAPE '$')";
$where .= " AND (dc.filetemplate LIKE CONCAT('%',:$st,'%') ESCAPE '$' OR dc.imagedirectory LIKE CONCAT('%',:" . ($st + 1) . ",'%') ESCAPE '$' OR smp.name LIKE CONCAT('%', :" . ($st + 2) . ",'%') ESCAPE '$')";
$where2 .= " AND (es.comments LIKE CONCAT('%',:" . ($st + 3) . ",'%') ESCAPE '$' OR es.element LIKE CONCAT('%',:" . ($st + 4) . ",'%') ESCAPE '$' OR smp.name LIKE CONCAT('%',:" . ($st + 5) . ",'%') ESCAPE '$')";
$where3 .= ' AND r.robotactionid < 0';
$where4 .= " AND (lower(xrf.filename) LIKE lower(CONCAT(CONCAT('%',:" . ($st + 6) . "), '%')) ESCAPE '$' OR lower(smp.name) LIKE lower(CONCAT(CONCAT('%',:" . ($st + 7) . "), '%')) ESCAPE '$')";
$where4 .= " AND (xrf.filename LIKE CONCAT('%',:" . ($st + 6) . ",'%') ESCAPE '$' OR smp.name LIKE CONCAT('%',:" . ($st + 7) . ",'%') ESCAPE '$')";

for ($i = 0; $i < 8; $i++)
array_push($args, $s);

}

# Set Count field
Expand Down Expand Up @@ -511,9 +512,9 @@ function _data_collections($single = null)
// $this->db->set_debug(True);

// will want to support these too at some point
$where2 = ' AND es.energyscanid < 0';
$where3 = ' AND r.robotactionid < 0';
$where4 = ' AND xrf.xfefluorescencespectrumid < 0';
$where2 .= ' AND es.energyscanid < 0';
$where3 .= ' AND r.robotactionid < 0';
$where4 .= ' AND xrf.xfefluorescencespectrumid < 0';

if ($this->has_arg('dcg')) {
$where .= ' AND dc.datacollectiongroupid=:' . (sizeof($args) + 1);
Expand Down

0 comments on commit 98b6d45

Please sign in to comment.