Lines 162-170
sub GetCourses {
Link Here
|
162 |
my @query_values; |
162 |
my @query_values; |
163 |
|
163 |
|
164 |
my $query = " |
164 |
my $query = " |
165 |
SELECT courses.* |
165 |
SELECT c.course_id, c.department, c.course_number, c.section, c.course_name, c.term, c.staff_note, c.public_note, c.students_count, c.enabled, c.timestamp |
166 |
FROM courses |
166 |
FROM courses c |
167 |
LEFT JOIN course_reserves ON course_reserves.course_id = courses.course_id |
167 |
LEFT JOIN course_reserves ON course_reserves.course_id = c.course_id |
168 |
LEFT JOIN course_items ON course_items.ci_id = course_reserves.ci_id |
168 |
LEFT JOIN course_items ON course_items.ci_id = course_reserves.ci_id |
169 |
"; |
169 |
"; |
170 |
|
170 |
|
Lines 180-186
sub GetCourses {
Link Here
|
180 |
$query .= join( ' AND ', @query_keys ); |
180 |
$query .= join( ' AND ', @query_keys ); |
181 |
} |
181 |
} |
182 |
|
182 |
|
183 |
$query .= " GROUP BY courses.course_id "; |
183 |
$query .= " GROUP BY c.course_id, c.department, c.course_number, c.section, c.course_name, c.term, c.staff_note, c.public_note, c.students_count, c.enabled, c.timestamp "; |
184 |
|
184 |
|
185 |
my $dbh = C4::Context->dbh; |
185 |
my $dbh = C4::Context->dbh; |
186 |
my $sth = $dbh->prepare($query); |
186 |
my $sth = $dbh->prepare($query); |
187 |
- |
|
|