Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
779 B
1
Indexable
Never
$getMissingSessionData = DB::select("SELECT csh.class_id, cs.teacher_id, csh.time, cs.name, cs.status, user.name teacherName
                                FROM `class_schedules` csh
                                join da_classes cs on (cs.id = csh.class_id and cs.teacher_id = csh.teacher_id and cs.status = 1 and csh.teacher_id != 3)
                                join users user on (user.id = cs.teacher_id)
                                where csh.day = '$day' and DATE(cs.created_at) >= '$date' and csh.class_id not in (
                                    select ses.class_id from class_sessions ses where ses.session_date = '$date'
                                )
                                order by user.name
                            ");
        }