You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$sql = "SELECT DISTINCT(p.id) AS id, p.title, model, sef_url, f.id AS fileid, MATCH (p.title,p.model,p.body) AGAINST ('" . $this->params['query'] . "*' IN BOOLEAN MODE) AS score ";
1793
+
$sql = "SELECT DISTINCT(p.id) AS id, ANY_VALUE(p.title) as title, ANY_VALUE(model) as model, ANY_VALUE(sef_url) as sef_url, ANY_VALUE(f.id) AS fileid, MATCH (p.title,p.model,p.body) AGAINST ('" . $this->params['query'] . "*' IN BOOLEAN MODE) AS score ";
1794
1794
$sql .= " FROM " . $db->tableStmt('product') . " AS p LEFT JOIN " .
1795
1795
$db->tableStmt('content_expFiles') . " AS cef ON p.id=cef.content_id AND cef.content_type IN ('product','eventregistration','donation','giftcard') AND cef.subtype='mainimage' LEFT JOIN " . $db->tableStmt('expFiles') .
1796
1796
" AS f ON cef.expFiles_id = f.id WHERE ";
@@ -1808,7 +1808,7 @@ public function search() {
1808
1808
}
1809
1809
1810
1810
// look for specific term in fields
1811
-
$sql = "SELECT DISTINCT(p.id) AS id, p.title, model, sef_url, f.id AS fileid FROM " . $db->tableStmt('product') . " AS p LEFT JOIN " .
1811
+
$sql = "SELECT DISTINCT(p.id) AS id, ANY_VALUE(p.title) as title, ANY_VALUE(model) as model, ANY_VALUE(sef_url) as sef_url, ANY_VALUE(f.id) AS fileid FROM " . $db->tableStmt('product') . " AS p LEFT JOIN " .
1812
1812
$db->tableStmt('content_expFiles') . " AS cef ON p.id=cef.content_id AND cef.content_type IN ('product','eventregistration','donation','giftcard') AND cef.subtype='mainimage' LEFT JOIN " . $db->tableStmt('expFiles') .
1813
1813
" AS f ON cef.expFiles_id = f.id WHERE ";
1814
1814
if (!($user->isAdmin())) $sql .= '(p.active_type=0 OR p.active_type IS NULL OR p.active_type=1) AND ';
@@ -1825,7 +1825,7 @@ public function search() {
1825
1825
}
1826
1826
1827
1827
// look for begins with term in fields
1828
-
$sql = "SELECT DISTINCT(p.id) AS id, p.title, model, sef_url, f.id AS fileid FROM " . $db->tableStmt('product') . " AS p LEFT JOIN " .
1828
+
$sql = "SELECT DISTINCT(p.id) AS id, ANY_VALUE(p.title) as title, ANY_VALUE(model) as model, ANY_VALUE(sef_url) as sef_url, ANY_VALUE(f.id) AS fileid FROM " . $db->tableStmt('product') . " AS p LEFT JOIN " .
1829
1829
$db->tableStmt('content_expFiles') . " AS cef ON p.id=cef.content_id AND cef.content_type IN ('product','eventregistration','donation','giftcard') AND cef.subtype='mainimage' LEFT JOIN " . $db->tableStmt('expFiles') .
1830
1830
" AS f ON cef.expFiles_id = f.id WHERE ";
1831
1831
if (!($user->isAdmin())) $sql .= '(p.active_type=0 OR p.active_type IS NULL OR p.active_type=1) AND ';
@@ -1859,7 +1859,8 @@ function sortSearch($a, $b) {
1859
1859
}
1860
1860
}
1861
1861
}
1862
-
usort($res, 'sortSearch');
1862
+
if (!empty($res))
1863
+
usort($res, 'sortSearch');
1863
1864
1864
1865
$ar = newexpAjaxReply(200, gt('Here\'s the items you wanted'), $res);
{control type="autocomplete"controller="store"action="search"name="search_string"label=$moduletitleplaceholder="Search title or SKU to locate item"schema="title,id,sef_url,expFile,model"searchmodel="product"searchoncol="title,model"maxresults=30 wwidth="80%"jsinject=$callbacks}
59
+
{control type="autocomplete"controller="store"action="search"name="search_string"label=$moduletitleplaceholder="Search title or SKU to locate item"schema="title,id,sef_url,expFile,model"searchmodel="product"searchoncol="title,model"maxresults=30 wwidth="80%"lwidth="100%"jsinject=$callbacks}
RECORD:O:8:"stdClass":21:{s:2:"id";s:1:"1";s:9:"eventdate";s:10:"1693526400";s:12:"eventenddate";s:10:"1693699200";s:15:"event_starttime";s:5:"32400";s:13:"event_endtime";s:5:"57600";s:13:"signup_cutoff";s:10:"1690911000";s:8:"location";s:10:"The Desert";s:8:"forms_id";s:1:"2";s:16:"multi_registrant";s:1:"0";s:27:"require_terms_and_condition";s:1:"1";s:19:"terms_and_condition";s:106:"<p>I will not blow up or drop any heavy object while at the convention, unless I see the Roadrunner.</p>\r\n";s:26:"terms_and_condition_toggle";s:1:"0";s:17:"earlydiscountdate";s:10:"1688169600";s:21:"early_discount_amount";s:1:"0";s:25:"early_discount_amount_mod";N;s:15:"use_early_price";s:1:"1";s:6:"poster";s:1:"0";s:10:"created_at";s:1:"0";s:9:"edited_at";s:1:"0";s:13:"location_data";s:0:"";s:6:"editor";s:1:"0";}
RECORD:O:8:"stdClass":21:{s:2:"id";s:1:"1";s:9:"eventdate";s:10:"1789948800";s:12:"eventenddate";s:10:"1790294400";s:15:"event_starttime";s:5:"32400";s:13:"event_endtime";s:5:"57600";s:13:"signup_cutoff";s:10:"1690911000";s:8:"location";s:10:"The Desert";s:8:"forms_id";s:1:"2";s:16:"multi_registrant";s:1:"0";s:27:"require_terms_and_condition";s:1:"1";s:19:"terms_and_condition";s:106:"<p>I will not blow up or drop any heavy object while at the convention, unless I see the Roadrunner.</p>\r\n";s:26:"terms_and_condition_toggle";s:1:"0";s:17:"earlydiscountdate";s:10:"1788134400";s:21:"early_discount_amount";s:1:"0";s:25:"early_discount_amount_mod";N;s:15:"use_early_price";s:1:"1";s:6:"poster";s:1:"0";s:10:"created_at";s:1:"0";s:9:"edited_at";s:1:"0";s:13:"location_data";s:0:"";s:6:"editor";s:1:"0";}
0 commit comments