Update alamat users

This commit is contained in:
ivan-sim
2023-12-29 15:22:17 +07:00
parent 7c2df15a9f
commit 31baf87202
4 changed files with 74 additions and 6 deletions

View File

@@ -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();

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->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');
});
}
};

View File

@@ -164,7 +164,7 @@
<tr>
<td>Kepada</td>
<td>:</td>
<td></td>
<td>{{ $rumahSakit->nama_rumahsakit }}</td>
<td>Plan Polis</td>
<td>:</td>
<td>{{ $dataMember->code_plan }}</td>
@@ -247,7 +247,7 @@
<td></td>
<td>Rumah Sakit</td>
<td>:</td>
<td></td>
<td>{{ $rumahSakit->nama_rumahsakit }}</td>
</tr>
<tr>
<td></td>
@@ -255,7 +255,7 @@
<td></td>
<td>Alamat</td>
<td>:</td>
<td></td>
<td>{{ $rumahSakit->alamat_rumahsakit }}</td>
</tr>
</table>
<table class="table-items">

View File

@@ -156,7 +156,7 @@
<tr>
<td>Kepada</td>
<td>:</td>
<td></td>
<td>{{ $rumahSakit->nama_rumahsakit }}</td>
<td>Plan Polis</td>
<td>:</td>
<td>{{ $dataMember->code_plan }}</td>
@@ -239,7 +239,7 @@
<td></td>
<td>Rumah Sakit</td>
<td>:</td>
<td></td>
<td>{{ $rumahSakit->nama_rumahsakit }}</td>
</tr>
<tr>
<td></td>
@@ -247,7 +247,7 @@
<td></td>
<td>Alamat</td>
<td>:</td>
<td></td>
<td>{{ $rumahSakit->alamat_rumahsakit }}</td>
</tr>
</table>
<div class="txt-pernyataan">