|
@@ -576,337 +576,8 @@ WHERE cl.shadow_pro_id IS NULL
|
|
|
$pro = $performer->pro;
|
|
|
$performerProID = $performer->pro->id;
|
|
|
|
|
|
- $keyNumbers = [];
|
|
|
-
|
|
|
- $queryClients = $pro->getAccessibleClientsQuery();
|
|
|
- $keyNumbers['patients'] = $queryClients->count();
|
|
|
-
|
|
|
- $pendingNotesToSign = Note::where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false)->where('is_core_note', false)->count();
|
|
|
- $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
|
|
|
-
|
|
|
- // notes pending mcp sign (applicable to dnas only)
|
|
|
- $pendingNotesToSignMCP = Note::where('ally_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false)->where('is_core_note', false)->count();
|
|
|
- $keyNumbers['$pendingNotesToSignMCP'] = $pendingNotesToSignMCP;
|
|
|
-
|
|
|
- $pendingNotesToSignAlly = Note::where(function ($query) use ($performerProID) {
|
|
|
- $query->where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false)->where('is_core_note', false);
|
|
|
- })->count();
|
|
|
- $keyNumbers['$pendingNotesToSignAlly'] = $pendingNotesToSignAlly;
|
|
|
-
|
|
|
-
|
|
|
- $signedNotesWithoutBills = Note::where(function ($query) use ($performerProID) {
|
|
|
- $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', true)->where('is_cancelled', false);
|
|
|
- })->whereDoesntHave('bills')->count();
|
|
|
-
|
|
|
- $keyNumbers['signedNotesWithoutBills'] = $signedNotesWithoutBills;
|
|
|
-
|
|
|
- // open tickets
|
|
|
- $keyNumbers['numOpenTickets'] = Ticket::where('is_open', true)
|
|
|
- ->where(function ($q) use ($performerProID) {
|
|
|
- $q->where('assigned_pro_id', $performerProID)
|
|
|
- ->orWhere('manager_pro_id', $performerProID)
|
|
|
- ->orWhere('ordering_pro_id', $performerProID)
|
|
|
- ->orWhere('initiating_pro_id', $performerProID);
|
|
|
- })
|
|
|
- ->count();
|
|
|
-
|
|
|
- // unacknowledged cancelled bills for authed pro
|
|
|
- $keyNumbers['unacknowledgedCancelledBills'] = Bill::where('na_pro_id', $performerProID)
|
|
|
- ->where('is_cancelled', true)
|
|
|
- ->where('is_cancellation_acknowledged', false)
|
|
|
- ->count();
|
|
|
-
|
|
|
- // unacknowledged cancelled supply orders for authed pro
|
|
|
- $keyNumbers['unacknowledgedCancelledSupplyOrders'] = SupplyOrder::where('signed_by_pro_id', $performerProID)
|
|
|
- ->where('is_cancelled', true)
|
|
|
- ->where('is_cancellation_acknowledged', false)
|
|
|
- ->count();
|
|
|
-
|
|
|
- // unsigned supply orders created by authed pro
|
|
|
- $keyNumbers['unsignedSupplyOrders'] = SupplyOrder
|
|
|
- ::where('is_cancelled', false)
|
|
|
- ->where('is_signed_by_pro', false)
|
|
|
- ->whereRaw('created_by_session_id IN (SELECT id FROM app_session WHERE pro_id = ?)', [$performerProID])
|
|
|
- ->count();
|
|
|
-
|
|
|
- // patientsHavingBirthdayToday
|
|
|
- $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
|
|
|
- $keyNumbers['patientsHavingBirthdayToday'] = $queryClients
|
|
|
- ->whereRaw('EXTRACT(DAY from dob) = ?', [date('d')])
|
|
|
- ->whereRaw('EXTRACT(MONTH from dob) = ?', [date('m')])
|
|
|
- ->count();
|
|
|
-
|
|
|
- $reimbursement = [];
|
|
|
- $reimbursement["currentBalance"] = $performer->pro->balance;
|
|
|
- $reimbursement["nextPaymentDate"] = '--';
|
|
|
- $lastPayment = ProTransaction::where('pro_id', $performerProID)->where('plus_or_minus', 'PLUS')->orderBy('created_at', 'DESC')->first();
|
|
|
- if ($lastPayment) {
|
|
|
- $reimbursement["lastPayment"] = $lastPayment->amount;
|
|
|
- $reimbursement["lastPaymentDate"] = $lastPayment->created_at;
|
|
|
- } else {
|
|
|
- $reimbursement["lastPayment"] = '--';
|
|
|
- $reimbursement["lastPaymentDate"] = '--';
|
|
|
- }
|
|
|
-
|
|
|
- //if today is < 15th, next payment is 15th, else nextPayment is
|
|
|
- $today = strtotime(date('Y-m-d'));
|
|
|
- $todayDate = date('j', $today);
|
|
|
-
|
|
|
- $todayMonth = date('m', $today);
|
|
|
- $todayYear = date('Y', $today);
|
|
|
- if ($todayDate < 15) {
|
|
|
- $nextPaymentDate = new DateTime();
|
|
|
- $nextPaymentDate->setDate($todayYear, $todayMonth, 15);
|
|
|
- $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
|
|
|
- } else {
|
|
|
- $nextPaymentDate = new \DateTime();
|
|
|
- $lastDayOfMonth = date('t', $today);
|
|
|
- $nextPaymentDate->setDate($todayYear, $todayMonth, $lastDayOfMonth);
|
|
|
- $reimbursement['nextPaymentDate'] = $nextPaymentDate->format('m/d/Y');
|
|
|
- }
|
|
|
-
|
|
|
- //expectedPay
|
|
|
- $expectedForCm = DB::select(DB::raw("SELECT coalesce(SUM(cm_expected_payment_amount),0) as expected_pay FROM bill WHERE cm_pro_id = :performerProID AND has_cm_been_paid = false AND is_signed_by_cm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
|
|
|
- $expectedForRme = DB::select(DB::raw("SELECT coalesce(SUM(rme_expected_payment_amount),0) as expected_pay FROM bill WHERE rme_pro_id = :performerProID AND has_rme_been_paid = false AND is_signed_by_rme IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
|
|
|
- $expectedForRmm = DB::select(DB::raw("SELECT coalesce(SUM(rmm_expected_payment_amount),0) as expected_pay FROM bill WHERE rmm_pro_id = :performerProID AND has_rmm_been_paid = false AND is_signed_by_rmm IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
|
|
|
- $expectedForNa = DB::select(DB::raw("SELECT coalesce(SUM(generic_pro_expected_payment_amount),0) as expected_pay FROM bill WHERE generic_pro_id = :performerProID AND has_generic_pro_been_paid = false AND is_signed_by_generic_pro IS TRUE AND is_cancelled = false"), ['performerProID' => $performerProID])[0]->expected_pay;
|
|
|
-
|
|
|
- $totalExpectedAmount = $expectedForCm + $expectedForRme + $expectedForRmm + $expectedForNa;
|
|
|
- $reimbursement['nextPaymentAmount'] = $totalExpectedAmount;
|
|
|
-
|
|
|
- $milliseconds = strtotime(date('Y-m-d')) . '000';
|
|
|
-
|
|
|
- // bills & claims
|
|
|
- $businessNumbers = [];
|
|
|
-
|
|
|
- // Notes with bills to resolve
|
|
|
- $businessNumbers['notesWithBillsToResolve'] = Note::where('is_cancelled', '!=', true)
|
|
|
- ->where('is_bill_closed', '!=', true)
|
|
|
- ->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND is_cancelled = false AND is_verified = false) > 0')
|
|
|
- ->count();
|
|
|
-
|
|
|
- // Notes pending bill closure
|
|
|
- $businessNumbers['notesPendingBillingClosure'] = Note::where('is_cancelled', '!=', true)
|
|
|
- ->where('is_bill_closed', '!=', true)
|
|
|
- ->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND (is_cancelled = true OR is_verified = true)) = 0')
|
|
|
- ->count();
|
|
|
-
|
|
|
- // incoming reports not signed
|
|
|
- $incomingReports = IncomingReport::where('hcp_pro_id', $performerProID)
|
|
|
- ->where('has_hcp_pro_signed', false)
|
|
|
- ->where('is_entry_error', false)
|
|
|
- ->orderBy('created_at', 'ASC')
|
|
|
- ->get();
|
|
|
- // erx, labs & imaging that are not closed
|
|
|
- $tickets = Ticket::where('ordering_pro_id', $performerProID)
|
|
|
- ->where('is_entry_error', false)
|
|
|
- ->where('is_open', true)
|
|
|
- ->orderBy('created_at', 'ASC')
|
|
|
- ->get();
|
|
|
- $supplyOrders = SupplyOrder::where('is_cleared_for_shipment', false)
|
|
|
- ->where('is_cancelled', false)
|
|
|
- ->whereRaw('created_by_session_id IN (SELECT id FROM app_session where pro_id = ?)', [$performer->pro->id])
|
|
|
- ->orderBy('created_at', 'ASC')
|
|
|
- ->get();
|
|
|
-
|
|
|
- $numERx = Ticket::where('ordering_pro_id', $performerProID)
|
|
|
- ->where('category', 'erx')
|
|
|
- ->where('is_entry_error', false)
|
|
|
- ->where('is_open', true)
|
|
|
- ->count();
|
|
|
- $numLabs = Ticket::where('ordering_pro_id', $performerProID)
|
|
|
- ->where('category', 'lab')
|
|
|
- ->where('is_entry_error', false)
|
|
|
- ->where('is_open', true)
|
|
|
- ->count();
|
|
|
- $numImaging = Ticket::where('ordering_pro_id', $performerProID)
|
|
|
- ->where('category', 'imaging')
|
|
|
- ->where('is_entry_error', false)
|
|
|
- ->where('is_open', true)
|
|
|
- ->count();
|
|
|
- $numSupplyOrders = SupplyOrder::where('is_cleared_for_shipment', false)
|
|
|
- ->where('is_cancelled', false)
|
|
|
- ->whereRaw('created_by_session_id IN (SELECT id FROM app_session where pro_id = ?)', [$performer->pro->id])
|
|
|
- ->count();
|
|
|
-
|
|
|
- $newMCPAssociations = ClientProChange
|
|
|
- ::where('new_pro_id', $performerProID)
|
|
|
- ->where('responsibility_type', 'MCP')
|
|
|
- ->whereNull('current_client_pro_change_decision_id')
|
|
|
- ->get();
|
|
|
-
|
|
|
- $newNAAssociations = ClientProChange
|
|
|
- ::where('new_pro_id', $performerProID)
|
|
|
- ->where('responsibility_type', 'DEFAULT_NA')
|
|
|
- ->whereNull('current_client_pro_change_decision_id')
|
|
|
- ->get();
|
|
|
-
|
|
|
- // unstamped client memos
|
|
|
- // for mcp
|
|
|
- $mcpClientMemos = DB::select(
|
|
|
- DB::raw("
|
|
|
-SELECT c.uid as client_uid, c.name_first, c.name_last,
|
|
|
- cm.uid, cm.content, cm.created_at
|
|
|
-FROM client c join client_memo cm on c.id = cm.client_id
|
|
|
-WHERE
|
|
|
- c.mcp_pro_id = {$performerProID} AND
|
|
|
- cm.mcp_stamp_id IS NULL
|
|
|
-ORDER BY cm.created_at DESC
|
|
|
- ")
|
|
|
- );
|
|
|
- // for na
|
|
|
- $naClientMemos = DB::select(
|
|
|
- DB::raw("
|
|
|
-SELECT c.uid as client_uid, c.name_first, c.name_last,
|
|
|
- cm.uid, cm.content, cm.created_at
|
|
|
-FROM client c join client_memo cm on c.id = cm.client_id
|
|
|
-WHERE
|
|
|
- c.default_na_pro_id = {$performerProID} AND
|
|
|
- cm.default_na_stamp_id IS NULL
|
|
|
-ORDER BY cm.created_at DESC
|
|
|
- ")
|
|
|
- );
|
|
|
-
|
|
|
- $keyNumbers['rmBillsToSign'] = Bill
|
|
|
- ::where('is_cancelled', false)
|
|
|
- ->where('cm_or_rm', 'RM')
|
|
|
- ->where(function ($q) use ($performerProID) {
|
|
|
- $q
|
|
|
- ->where(function ($q2) use ($performerProID) {
|
|
|
- $q2->where('rme_pro_id', $performerProID)->where('is_signed_by_rme', false);
|
|
|
- })
|
|
|
- ->orWhere(function ($q2) use ($performerProID) {
|
|
|
- $q2->where('rmm_pro_id', $performerProID)->where('is_signed_by_rmm', false);
|
|
|
- })
|
|
|
- ->orWhere(function ($q2) use ($performerProID) {
|
|
|
- $q2->where('generic_pro_id', $performerProID)->where('is_signed_by_generic_pro', false);
|
|
|
- });
|
|
|
- })
|
|
|
- ->count();
|
|
|
-
|
|
|
- $count = DB::select(
|
|
|
- DB::raw(
|
|
|
- "
|
|
|
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
-WHERE ( (client.rmm_pro_id = {$performer->pro->id})
|
|
|
- OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
- AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
|
|
|
- AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
|
|
|
- AND (care_month.number_of_days_with_remote_measurements < 16 OR care_month.number_of_days_with_remote_measurements IS NULL)
|
|
|
-"
|
|
|
- )
|
|
|
- );
|
|
|
- $keyNumbers['rmPatientsWithLT16MD'] = $count[0]->cnt;
|
|
|
-
|
|
|
- $count = DB::select(
|
|
|
- DB::raw(
|
|
|
- "
|
|
|
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
-WHERE ((client.rmm_pro_id = {$performer->pro->id})
|
|
|
- OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
- AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
|
|
|
- AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
|
|
|
- AND (care_month.number_of_days_with_remote_measurements >= 16 AND care_month.number_of_days_with_remote_measurements IS NOT NULL)
|
|
|
-"
|
|
|
- )
|
|
|
- );
|
|
|
- $keyNumbers['rmPatientsWithGTE16MD'] = $count[0]->cnt;
|
|
|
-
|
|
|
- $count = DB::select(
|
|
|
- DB::raw(
|
|
|
- "
|
|
|
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
-WHERE ((client.rmm_pro_id = {$performer->pro->id})
|
|
|
- OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
- AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
|
|
|
- AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
|
|
|
- AND (care_month.has_anyone_interacted_with_client_about_rm_outside_note = TRUE AND care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NOT NULL)
|
|
|
-"
|
|
|
- )
|
|
|
- );
|
|
|
- $keyNumbers['rmPatientsWithWhomCommDone'] = $count[0]->cnt;
|
|
|
-
|
|
|
- $count = DB::select(
|
|
|
- DB::raw(
|
|
|
- "
|
|
|
-SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
-WHERE ( (client.rmm_pro_id = {$performer->pro->id})
|
|
|
- OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
- AND EXTRACT(MONTH from care_month.start_date) = EXTRACT(MONTH from now())
|
|
|
- AND EXTRACT(YEAR from care_month.start_date) = EXTRACT(YEAR from now())
|
|
|
- AND (care_month.has_anyone_interacted_with_client_about_rm_outside_note = FALSE OR care_month.has_anyone_interacted_with_client_about_rm_outside_note IS NULL)
|
|
|
-"
|
|
|
- )
|
|
|
- );
|
|
|
- $keyNumbers['rmPatientsWithWhomCommNotDone'] = $count[0]->cnt;
|
|
|
-
|
|
|
- // num measurements that need stamping
|
|
|
- $keyNumbers['measurementsToBeStamped'] = $this->performer()->pro->getUnstampedMeasurementsFromCurrentMonth(true, null, null);
|
|
|
-
|
|
|
- if($performer->pro->pro_type === 'ADMIN') {
|
|
|
-
|
|
|
- // patients without coverage information
|
|
|
- $keyNumbers['patientsWithoutCoverageInformation'] = DB::select(DB::raw("
|
|
|
-SELECT count(DISTINCT (cl.id)) as cnt
|
|
|
-FROM client cl
|
|
|
-WHERE cl.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
- ))[0]->cnt;
|
|
|
-
|
|
|
- // patients pending coverage verification
|
|
|
- $keyNumbers['patientsPendingCoverageVerification'] = DB::select(DB::raw("
|
|
|
-SELECT count(DISTINCT (cl.id)) as cnt
|
|
|
-FROM client cl
|
|
|
- LEFT JOIN client_primary_coverage cpc ON cl.latest_client_primary_coverage_id = cpc.id
|
|
|
-WHERE cl.shadow_pro_id IS NULL
|
|
|
- AND (cl.latest_client_primary_coverage_id IS NOT NULL -- coverage exists, but status is null or unknown
|
|
|
- AND (
|
|
|
- (cpc.plan_type = 'MEDICARE' AND (cpc.is_partbprimary = 'UNKNOWN' OR cpc.is_partbprimary IS NULL))
|
|
|
- OR
|
|
|
- (cpc.plan_type != 'MEDICARE' AND
|
|
|
- (cpc.manual_determination_category = 'UNKNOWN' OR cpc.manual_determination_category IS NULL))
|
|
|
- ))"
|
|
|
- ))[0]->cnt;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- $incomingSmsMessagesPendingReply = DB::select("
|
|
|
- SELECT cs.* ,c.uid as client_uid, c.name_first as client_name_first, c.name_last as client_name_last FROM client_sms cs LEFT JOIN client c ON c.id = cs.client_id
|
|
|
- WHERE cs.is_reply_needed = 'YES' AND c.mcp_pro_id = :mcp_pro_id AND incoming_or_outgoing = 'INCOMING'
|
|
|
- AND (cs.created_at > c.last_sms_sent_to_client_at OR c.last_sms_sent_to_client_at IS NULL)
|
|
|
- ORDER BY created_at DESC
|
|
|
- ", ['mcp_pro_id' => $performer->pro->id]);
|
|
|
-
|
|
|
- $careMonthsWithMeasurementsPendingStamping = CareMonth::select('id')
|
|
|
- ->where('mcp_pro_id', $this->performer->pro->id)
|
|
|
- ->where('rm_num_measurements_not_stamped_by_mcp', '>', 0)
|
|
|
- ->whereNotNull('rm_num_measurements_not_stamped_by_mcp')
|
|
|
- ->orderBy('created_at', 'DESC')
|
|
|
- ->get()
|
|
|
- ->map(function($_x) {
|
|
|
- return $_x->id;
|
|
|
- })
|
|
|
- ->toArray();
|
|
|
-
|
|
|
- $measurementsPendingStamping = Measurement::whereIn('care_month_id', $careMonthsWithMeasurementsPendingStamping)
|
|
|
- ->orderBy('created_at', 'DESC')
|
|
|
- ->whereNotNull('ts')
|
|
|
- ->whereNotIn('label', ['SBP', 'DBP'])
|
|
|
- ->where('is_cellular_zero', '<>', true)
|
|
|
- ->where('is_removed', false)
|
|
|
- ->where('has_been_stamped_by_mcp', false)
|
|
|
- ->whereNotNull('client_bdt_measurement_id')
|
|
|
- ->whereHas('client', function($clientQuery) use ($performerProID){
|
|
|
- return $clientQuery->where('default_na_pro_id', $performerProID);
|
|
|
- })
|
|
|
- ->paginate(15);
|
|
|
-
|
|
|
-
|
|
|
- return view('app/dashboard-dna', compact('keyNumbers', 'reimbursement', 'milliseconds',
|
|
|
- 'businessNumbers',
|
|
|
- 'incomingReports', 'tickets', 'supplyOrders',
|
|
|
- 'numERx', 'numLabs', 'numImaging', 'numSupplyOrders',
|
|
|
- 'newMCPAssociations', 'newNAAssociations',
|
|
|
- 'mcpClientMemos', 'naClientMemos', 'measurementsPendingStamping', 'careMonthsWithMeasurementsPendingStamping', 'incomingSmsMessagesPendingReply'));
|
|
|
+ $milliseconds = strtotime(date('Y-m-d')) . '000'; //required by the calendar
|
|
|
+ return view('app/dashboard-dna', compact( 'milliseconds'));
|
|
|
}
|
|
|
|
|
|
private function dashboard_ADMIN(Request $request){
|
|
@@ -1393,7 +1064,12 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
|
|
|
$results = DB::table('appointment')->select('raw_date')->distinct()->where("start_time", '>=', $from)->where("start_time", '<=', $to.' 23:59:00+00');
|
|
|
|
|
|
if(!$isAdmin) {
|
|
|
- $results = $results->where("pro_id", $performerProID);
|
|
|
+ $appointments = $appointments->where(function($q) use ($performerProID) {
|
|
|
+ return $q->where("pro_id", $performerProID)
|
|
|
+ ->orWhereHas('client', function($clientQuery) use ($performerProID){
|
|
|
+ return $clientQuery->where('default_na_pro_id', $performerProID);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
$results = $results->get();
|
|
@@ -1421,7 +1097,12 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
|
|
|
$appointments = Appointment::where("raw_date", '=', $from);
|
|
|
|
|
|
if(!$isAdmin) {
|
|
|
- $appointments = $appointments->where("pro_id", $performerProID);
|
|
|
+ $appointments = $appointments->where(function($q) use ($performerProID) {
|
|
|
+ return $q->where("pro_id", $performerProID)
|
|
|
+ ->orWhereHas('client', function($clientQuery) use ($performerProID){
|
|
|
+ return $clientQuery->where('default_na_pro_id', $performerProID);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
$appointments = $appointments
|
|
@@ -1482,7 +1163,12 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
|
|
|
$appointments = Appointment::where("raw_date", '=', $from);
|
|
|
|
|
|
if(!$isAdmin) {
|
|
|
- $appointments = $appointments->where("pro_id", $performerProID);
|
|
|
+ $appointments = $appointments->where(function($q) use ($performerProID) {
|
|
|
+ return $q->where("pro_id", $performerProID)
|
|
|
+ ->orWhereHas('client', function($clientQuery) use ($performerProID){
|
|
|
+ return $clientQuery->where('default_na_pro_id', $performerProID);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
$appointments = $appointments
|