Fix provider filter (#1530)

This commit is contained in:
Alex Tselegidis 2024-05-21 15:39:45 +02:00
parent 7713f3ffa6
commit 4703df1ada
2 changed files with 4 additions and 2 deletions

View file

@ -635,8 +635,10 @@ class Providers_model extends EA_Model
->select('users.*')
->from('users')
->join('roles', 'roles.id = users.id_roles', 'inner')
->join('services_providers', 'services_providers.id_users = users.id', 'inner')
->where('roles.slug', DB_SLUG_PROVIDER)
->order_by('first_name ASC, last_name ASC, email ASC')
->group_by('users.id')
->get()
->result_array();

View file

@ -550,8 +550,8 @@ App.Utils.CalendarTableView = (function () {
'text': App.Utils.Date.format(date, vars('date_format'), vars('time_format')),
}).appendTo($dateColumn);
const filterProviderIds = $filterProvider.val();
const filterServiceIds = $filterService.val();
const filterProviderIds = $filterProvider.val().map((filterProviderId) => Number(filterProviderId));
const filterServiceIds = $filterService.val().map((filterServiceId) => Number(filterServiceId));
let providers = vars('available_providers').filter((provider) => {
const servedServiceIds = provider.services.filter((serviceId) => {