|
@@ -3313,7 +3313,8 @@ ORDER BY c.name_last, c.name_first
|
|
|
n.id NOT IN (SELECT note_id FROM claim WHERE note_id IS NOT NULL) AND
|
|
|
c.is_part_b_primary = 'YES' AND
|
|
|
c.latest_eligible_refresh_at::DATE >= '2022-01-01' AND
|
|
|
- c.mpb_remaining = 0
|
|
|
+ c.mpb_remaining = 0 AND
|
|
|
+ c.created_at::DATE >= '2022-01-01'::DATE
|
|
|
";
|
|
|
$filters = [];
|
|
|
if($request->input('f')) {
|
|
@@ -3329,21 +3330,23 @@ ORDER BY c.name_last, c.name_first
|
|
|
$filters = '';
|
|
|
}
|
|
|
// $filters = '';
|
|
|
- $orderBy = "ORDER BY c.chart_number ASC, n.effective_dateest ASC";
|
|
|
+ $orderBy = "ORDER BY c.id ASC, n.effective_dateest ASC";
|
|
|
|
|
|
$countQuery = "SELECT count(*) {$from} {$where} {$filters}";
|
|
|
// dd($countQuery);
|
|
|
$countResult = DB::select($countQuery);
|
|
|
$total = $countResult[0]->count;
|
|
|
|
|
|
+ $defaultPageSize = 25;
|
|
|
+
|
|
|
$page = $request->input('page') ?: 1;
|
|
|
- $perPage = $request->input('per_page') ?: 20;
|
|
|
+ $perPage = $request->input('per_page') ?: $defaultPageSize;
|
|
|
$offset = ($page - 1) * $perPage;
|
|
|
|
|
|
$dataQuery = "SELECT {$columns} {$from} {$where} {$filters} {$orderBy} OFFSET {$offset} LIMIT {$perPage}";
|
|
|
$rows = DB::select($dataQuery);
|
|
|
|
|
|
- $paginator = new LengthAwarePaginator($rows, $total, $request->input('per_page') ?: 20, $request->input('page') ?: 1);
|
|
|
+ $paginator = new LengthAwarePaginator($rows, $total, $request->input('per_page') ?: $defaultPageSize, $request->input('page') ?: 1);
|
|
|
$paginator->setPath(route('practice-management.notes-resolution-center'));
|
|
|
|
|
|
return view('app.practice-management.notes-resolution-center', compact('rows', 'paginator'));
|