Skip to content

Commit

Permalink
add category check for search results
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrgay committed Feb 3, 2018
1 parent e031d94 commit ff5d693
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/classes/DAO/CoursesDAO.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,14 @@ public function getSearchResult($keywords, $catid='', $start=0, $maxResults=0)
WHERE cs.access='public'
AND cs.course_id = ct.course_id
AND cs.user_id = u.user_id ";

if (trim($catid) <> ''){
$sql_where .= ' category_id=?';
$values[] = $catid;
$types .="i";
}
if ($sql_where <> ''){
$sql .= " AND ".$sql_where;

$sql .= " AND ".$sql_where;
}
if ($sql_order <> ''){
$sql .= " ORDER BY ? DESC ";
Expand Down

0 comments on commit ff5d693

Please sign in to comment.