autolinking dan manual linking
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user