This commit is contained in:
2024-05-02 10:56:23 +07:00
parent 3ed0242963
commit 9f55783508

View File

@@ -6,6 +6,7 @@ use App\Helpers\Helper;
use App\Models\OLDLMS\Livechat;
use App\Models\OLDLMS\LivechatSummary;
use App\Models\OLDLMS\Appointment;
use App\Models\OLDLMS\Dokter;
use App\Models\OLDLMS\User;
use App\Models\OLDLMS\UserDetail;
use App\Models\OLDLMS\Prescription;
@@ -96,6 +97,8 @@ class PrescriptionController extends Controller
$livechat = Livechat::where('nID', $request->id)->first();
$livechatSummary = LivechatSummary::where('nIDLivechat', $request->id)->first();
$dokterData = Dokter::where('nIDUser', $livechat->nIDDokter)->first();
$nIDDokter = $dokterData ? $dokterData->nID : $livechat->nIDDokter;
$userDokter = User::where('nID', $livechat->nIDDokter)->first();
$userDetailDokter = UserDetail::where('nIDUser', $userDokter->nID)->first();
@@ -120,7 +123,7 @@ class PrescriptionController extends Controller
$data = [
'nIDLivechat' => $request->id,
'nIDLivechatSummary' => $livechatSummary->nID,
'nIDDokter' => $livechat->nIDDokter,
'nIDDokter' => $nIDDokter,
'sDokterName' => $dokter,
'dTanggalResep' => date('Y-m-d H:i:s'),
'sSource' => 'lms',