Corrected issue with attendants number query

This commit is contained in:
Alex Tselegidis 2020-06-14 10:56:35 +02:00
parent 1821e50116
commit e857d3a37e

View file

@ -545,6 +545,7 @@ class Appointments_Model extends CI_Model {
->select('count(*) AS attendants_number') ->select('count(*) AS attendants_number')
->from('appointments') ->from('appointments')
->group_start() ->group_start()
->group_start()
->where('start_datetime <=', $slot_start->format('Y-m-d H:i:s')) ->where('start_datetime <=', $slot_start->format('Y-m-d H:i:s'))
->where('end_datetime >', $slot_start->format('Y-m-d H:i:s')) ->where('end_datetime >', $slot_start->format('Y-m-d H:i:s'))
->group_end() ->group_end()
@ -552,6 +553,7 @@ class Appointments_Model extends CI_Model {
->where('start_datetime <', $slot_end->format('Y-m-d H:i:s')) ->where('start_datetime <', $slot_end->format('Y-m-d H:i:s'))
->where('end_datetime >=', $slot_end->format('Y-m-d H:i:s')) ->where('end_datetime >=', $slot_end->format('Y-m-d H:i:s'))
->group_end() ->group_end()
->group_end()
->where('id_services', $service_id) ->where('id_services', $service_id)
->get() ->get()
->row() ->row()