update request log pdf
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Modules\Internal\Transformers;
|
||||
|
||||
use App\Models\Benefit;
|
||||
use App\Models\Plan;
|
||||
use App\Models\CorporateBenefit;
|
||||
use App\Models\ClaimRequest;
|
||||
use App\Models\MemberPlan;
|
||||
use App\Models\CorporateService;
|
||||
use App\Models\RequestLogBenefit;
|
||||
use App\Models\RequestLogMedicine;
|
||||
@@ -24,12 +24,23 @@ class RequestLogShowResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
// $requestLog = parent::toArray($request);
|
||||
// $corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
|
||||
|
||||
$requestLog = parent::toArray($request);
|
||||
$corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
|
||||
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $corporateId)->get()->toArray();
|
||||
$member_id = $requestLog['member_id'];
|
||||
$planMember = MemberPlan::where('member_id', $member_id)->get('plan_id');
|
||||
$planId = Plan::whereIn('id', $planMember)->where('service_code', $requestLog['service_code'])->first();
|
||||
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $planId->id)->get()->toArray();
|
||||
$benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||
$medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||
$benefitData = [];
|
||||
|
||||
// $benefit = CorporateBenefit::with('benefit')->where('plan_id', $corporateId)->get()->toArray();
|
||||
// $benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||
// $medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||
// $benefitData = [];
|
||||
if (count($benefit)){
|
||||
foreach($benefit as $data){
|
||||
array_push($benefitData, $data['benefit']);
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
</div>
|
||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
|
||||
@php
|
||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
||||
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||
@endphp
|
||||
<u><b>Dr. Hery Hermas, M.Kes</b></u>
|
||||
@php
|
||||
@@ -281,7 +281,7 @@
|
||||
</div>
|
||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
|
||||
@php
|
||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
||||
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||
@endphp
|
||||
|
||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||
@@ -289,7 +289,7 @@
|
||||
Lt. 1, Jalan Somba Opu 281, Ujung Pandang, Losari, <br> Kec. Makassar, Kota Makassar, Sulawesi Selatan 90113
|
||||
|
||||
@php
|
||||
} else if(!empty($logoPerusahaan->code) === 'PETROLAB') {
|
||||
} else if(!empty($logoPerusahaan->code) == 'PETROLAB') {
|
||||
@endphp
|
||||
|
||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
</div>
|
||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
|
||||
@php
|
||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
||||
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||
@endphp
|
||||
<u><b>Dr. Hery Hermas, M.Kes</b></u>
|
||||
@php
|
||||
@@ -450,7 +450,7 @@
|
||||
</div>
|
||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
|
||||
@php
|
||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
||||
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||
@endphp
|
||||
|
||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||
@@ -458,7 +458,7 @@
|
||||
Lt. 1, Jalan Somba Opu 281, Ujung Pandang, Losari, <br> Kec. Makassar, Kota Makassar, Sulawesi Selatan 90113
|
||||
|
||||
@php
|
||||
} else if(!empty($logoPerusahaan->code) === 'PETROLAB') {
|
||||
} else if(!empty($logoPerusahaan->code) == 'PETROLAB') {
|
||||
@endphp
|
||||
|
||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||
|
||||
Reference in New Issue
Block a user