Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1390: Fix searching of data collection groups #833

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading