fix – appointment limit calculation

Support forumfix – appointment limit calculation
mjch Staff asked 4 years ago
Hi - we found a problem where adding attendee limits for services was behaving badly.  There is an SQL logic issue in get_attendants_number_for_period() which should have an extra group_start()/group_end() pair and read: public function get_attendants_number_for_period(DateTime $slot_start, DateTime $slot_end, $service_id)
return (int)$this->db
->select('count(*) AS attendants_number')
->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('start_datetime <', $slot_end->format('Y-m-d H:i:s'))
->where('end_datetime >=', $slot_end->format('Y-m-d H:i:s'))
->where('id_services', $service_id)
} Regards,
1 Answers
Best Answer
Nikola Loncar Staff answered 4 years ago
Hi, thanks for that. I will see to test it and if it is ok it will be part of next version of EA :) Best regards, Nikola