This commit is contained in:
parent
dfacdc901a
commit
50ec06b29c
2 changed files with 41 additions and 2 deletions
|
@ -87,6 +87,33 @@ class Appointments_api_v1 extends EA_Controller {
|
|||
$where['DATE(end_datetime) <='] = (new DateTime($till))->format('Y-m-d');
|
||||
}
|
||||
|
||||
// Service ID query param.
|
||||
|
||||
$service_id = request('serviceId');
|
||||
|
||||
if ( ! empty($service_id))
|
||||
{
|
||||
$where['id_services'] = $service_id;
|
||||
}
|
||||
|
||||
// Provider ID query param.
|
||||
|
||||
$provider_id = request('providerId');
|
||||
|
||||
if ( ! empty($provider_id))
|
||||
{
|
||||
$where['id_users_provider'] = $provider_id;
|
||||
}
|
||||
|
||||
// Customer ID query param.
|
||||
|
||||
$customer_id = request('customerId');
|
||||
|
||||
if ( ! empty($customer_id))
|
||||
{
|
||||
$where['id_users_customer'] = $customer_id;
|
||||
}
|
||||
|
||||
$appointments = empty($keyword)
|
||||
? $this->appointments_model->get($where, $limit, $offset, $order_by)
|
||||
: $this->appointments_model->search($keyword, $limit, $offset, $order_by);
|
||||
|
|
16
openapi.yml
16
openapi.yml
|
@ -104,14 +104,26 @@ paths:
|
|||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: start
|
||||
- name: from
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: end
|
||||
- name: till
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: serviceId
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
- name: providerId
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
- name: customerId
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
|
Loading…
Reference in a new issue