Добавлен фильтр на день

This commit is contained in:
brusnitsyn
2026-01-13 16:08:55 +09:00
parent eea1f61447
commit 67b34d4bf2

View File

@@ -10,6 +10,7 @@ use App\Models\MisMedicalHistory;
use App\Models\ObservationPatient;
use App\Models\Report;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
@@ -109,6 +110,7 @@ class ReportController extends Controller
DB::raw('ROW_NUMBER() OVER (ORDER BY "DateRecipient" DESC) as num')
])
->where('rf_EmerSignID', 1)
->whereDate('DateRecipient', '>=', Carbon::now()->format('Y-m-d'))
->orderBy('DateRecipient', 'DESC')
->get();
} else if ($status === 'emergency') {
@@ -118,7 +120,9 @@ class ReportController extends Controller
DB::raw('ROW_NUMBER() OVER (ORDER BY "DateRecipient" DESC) as num')
])
->where('rf_EmerSignID', 2)
->whereDate('DateRecipient', '>=', Carbon::now()->format('Y-m-d'))
->orderBy('DateRecipient', 'DESC')
->limit(20)
->get();
}
@@ -137,11 +141,13 @@ class ReportController extends Controller
if ($status === 'plan') {
$count = MisMedicalHistory::select($model->getFillable())
->where('rf_EmerSignID', 1)
->whereDate('DateRecipient', '>=', Carbon::now()->format('Y-m-d'))
->orderBy('DateRecipient', 'DESC')
->count();
} else if ($status === 'emergency') {
$count = MisMedicalHistory::select($model->getFillable())
->where('rf_EmerSignID', 2)
->whereDate('DateRecipient', '>=', Carbon::now()->format('Y-m-d'))
->orderBy('DateRecipient', 'DESC')
->count();
}