autolinking dan manual linking

This commit is contained in:
Linksehat Staging Server
2023-11-13 10:23:45 +07:00
parent 3a83f90ee3
commit db275c152d
5 changed files with 68 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ namespace Modules\Linksehat\Transformers\User;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\OLDLMS\User;
use App\Models\OLDLMS\UserDetail;
use App\Models\OLDLMS\UserInsurance;
use DB;
@@ -53,6 +54,11 @@ class ShowProfileResource extends JsonResource
$relationship = DB::connection('oldlms')->table('tm_hubungan_keluarga')->where('nID', $this->nIDHubunganKeluarga)->first('sHubunganKeluarga');
// dd( $this->detail->nIDGolonganDarah);
$userInsurance = UserInsurance::where('nIDUser', $this->nID)->get()->first();
$memberId = Null;
if($userInsurance){
$memberId = $userInsurance->sNoPolis;
}
return [
'id' => $this->nID,
'first_name' => $this->sFirstName,
@@ -67,6 +73,7 @@ class ShowProfileResource extends JsonResource
'relationship' => $relationship ? $relationship->sHubunganKeluarga : '-',
'weight' => $this->detail->sWeight,
'height' => $this->detail->sHeight,
'member_id' => $memberId,
];
}
}