diff --git a/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php b/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php index 9e8f056a..d07fc43a 100644 --- a/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php +++ b/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php @@ -350,6 +350,24 @@ class RequestLogController extends Controller $data['request_logs'] = $dataRequestLog; + $dataRumahSakit = DB::table('users') + ->where('users.id', '=', $dataRequestLog->created_by) + ->select( + '*', + DB::raw(' + (Select organizations.name FROM organizations + WHERE organizations.id = users.organization_id LIMIT 1) AS nama_rumahsakit + '), + DB::raw(' + (Select addresses.text FROM organizations + INNER JOIN addresses ON addresses.id = organizations.main_address_id + WHERE organizations.id = users.organization_id LIMIT 1) AS alamat_rumahsakit + ') + ) + ->first(); + + $data['rumahSakit'] = $dataRumahSakit; + $pdf = new Dompdf(); $options = new Options(); @@ -456,6 +474,24 @@ class RequestLogController extends Controller $data['dataClaimLog'] = $dataClaimLog; + $dataRumahSakit = DB::table('users') + ->where('users.id', '=', $dataRequestLog->created_by) + ->select( + '*', + DB::raw(' + (Select organizations.name FROM organizations + WHERE organizations.id = users.organization_id LIMIT 1) AS nama_rumahsakit + '), + DB::raw(' + (Select addresses.text FROM organizations + INNER JOIN addresses ON addresses.id = organizations.main_address_id + WHERE organizations.id = users.organization_id LIMIT 1) AS alamat_rumahsakit + ') + ) + ->first(); + + $data['rumahSakit'] = $dataRumahSakit; + $pdf = new Dompdf(); $options = new Options(); diff --git a/database/migrations/2023_12_29_150722_add_column_to_users.php b/database/migrations/2023_12_29_150722_add_column_to_users.php new file mode 100644 index 00000000..5550b03d --- /dev/null +++ b/database/migrations/2023_12_29_150722_add_column_to_users.php @@ -0,0 +1,32 @@ +bigInteger('organization_id')->after('person_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('organization_id'); + }); + } +}; diff --git a/resources/views/pdf/final_log_page_1.blade.php b/resources/views/pdf/final_log_page_1.blade.php index 80eeb827..4133f984 100644 --- a/resources/views/pdf/final_log_page_1.blade.php +++ b/resources/views/pdf/final_log_page_1.blade.php @@ -164,7 +164,7 @@
| Kepada | : | -+ | {{ $rumahSakit->nama_rumahsakit }} | Plan Polis | : | {{ $dataMember->code_plan }} | @@ -239,7 +239,7 @@Rumah Sakit | : | -+ | {{ $rumahSakit->nama_rumahsakit }} | |
| @@ -247,7 +247,7 @@ | Alamat | : | -+ | {{ $rumahSakit->alamat_rumahsakit }} |