Skip to content

Commit 7df5efa

Browse files
committed
student filter
1 parent 027a9b8 commit 7df5efa

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

classes/Utils.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,11 +3494,11 @@ public function get_students_by_instructor( int $instructor_id, int $offset, int
34943494
$students = $wpdb->get_results(
34953495
$wpdb->prepare(
34963496
"SELECT COUNT(enrollment.post_author) AS course_taken, user.*, (SELECT post_date FROM {$wpdb->posts} WHERE post_author = user.ID LIMIT 1) AS enroll_date
3497-
FROM {$wpdb->posts} enrollment
3498-
INNER JOIN {$wpdb->posts} AS course
3499-
ON enrollment.post_parent=course.ID
3500-
INNER JOIN {$wpdb->users} AS user
3501-
ON user.ID = enrollment.post_author
3497+
FROM {$wpdb->posts} enrollment
3498+
INNER JOIN {$wpdb->posts} AS course
3499+
ON enrollment.post_parent=course.ID
3500+
INNER JOIN {$wpdb->users} AS user
3501+
ON user.ID = enrollment.post_author
35023502
WHERE course.post_type = %s
35033503
AND course.post_status IN ({$post_status})
35043504
AND enrollment.post_type = %s
@@ -3507,11 +3507,9 @@ public function get_students_by_instructor( int $instructor_id, int $offset, int
35073507
{$course_query}
35083508
{$date_query}
35093509
AND ( user.display_name LIKE %s OR user.user_nicename LIKE %s OR user.user_email = %s OR user.user_login LIKE %s )
3510-
35113510
GROUP BY enrollment.post_author
35123511
ORDER BY {$order_by} {$order}
3513-
LIMIT %d, %d
3514-
",
3512+
LIMIT %d, %d",
35153513
$course_post_type,
35163514
'tutor_enrolled',
35173515
'completed',
@@ -3540,9 +3538,7 @@ public function get_students_by_instructor( int $instructor_id, int $offset, int
35403538
{$course_query}
35413539
{$date_query}
35423540
GROUP BY enrollment.post_author
3543-
ORDER BY {$order_by} {$order}
3544-
3545-
",
3541+
ORDER BY {$order_by} {$order}",
35463542
$course_post_type,
35473543
'tutor_enrolled',
35483544
'completed',

0 commit comments

Comments
 (0)