如何将这个标准的sql放到laravel查询中?

时间:2017-06-19 04:36:22

标签: php laravel laravel-5.3

如何将这个标准的sql放到laravel 5.3查询?

SELECT a.emp_id, d.course_code, d.start_time, d.end_time,
( SELECT time FROM hris_biometrics_attendance WHERE date = '2017-06-13' AND time BETWEEN d.start_time - 1 AND d.end_time -1 AND emp_id = a.emp_id) AS time_in,
( SELECT time FROM hris_biometrics_attendance WHERE date = '2017-06-13' AND time BETWEEN d.end_time - 1 AND d.end_time + 1 AND emp_id = a.emp_id) AS time_out FROM hris_ftl_final_courses a, hris_ftl_final_courses_details d

1 个答案:

答案 0 :(得分:0)

$ sql =您的查询; return DB :: select($ sql);