[Client Portal] Alarm Center
This commit is contained in:
@@ -197,6 +197,11 @@ class Member extends Model
|
||||
{
|
||||
return $this->hasOneThrough(CorporateDivision::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'division_id');
|
||||
}
|
||||
|
||||
public function requestLogs()
|
||||
{
|
||||
return $this->hasMany(RequestLog::class);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
@@ -270,13 +275,13 @@ class Member extends Model
|
||||
protected function relations(): Attribute
|
||||
{
|
||||
$relation = '-';
|
||||
if ($this->relation_with_principal == 'H'){
|
||||
if ($this->relation_with_principal == 'H') {
|
||||
$relation = 'Husbund';
|
||||
} else if ($this->relation_with_principal == 'W'){
|
||||
} else if ($this->relation_with_principal == 'W') {
|
||||
$relation = 'Wife';
|
||||
} else if ($this->relation_with_principal == 'S'){
|
||||
} else if ($this->relation_with_principal == 'S') {
|
||||
$relation = 'Son';
|
||||
} else if ($this->relation_with_principal == 'D'){
|
||||
} else if ($this->relation_with_principal == 'D') {
|
||||
$relation = 'Daughter';
|
||||
}
|
||||
return Attribute::make(
|
||||
@@ -287,11 +292,11 @@ class Member extends Model
|
||||
protected function statusMarital(): Attribute
|
||||
{
|
||||
$maritalStatus = '-';
|
||||
if ($this->marital_status == 'M'){
|
||||
if ($this->marital_status == 'M') {
|
||||
$maritalStatus = 'Married';
|
||||
} else if ($this->relation_with_principal == 'D'){
|
||||
} else if ($this->relation_with_principal == 'D') {
|
||||
$maritalStatus = 'Divorced';
|
||||
} else if ($this->relation_with_principal == 'S'){
|
||||
} else if ($this->relation_with_principal == 'S') {
|
||||
$maritalStatus = 'Single';
|
||||
}
|
||||
return Attribute::make(
|
||||
@@ -311,12 +316,12 @@ class Member extends Model
|
||||
protected function birthDateeCard(): Attribute
|
||||
{
|
||||
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||
if ($this->birth_date){
|
||||
if ($this->birth_date) {
|
||||
$date = $this->birth_date;
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||
);
|
||||
} else if ($this->person->birth_date){
|
||||
} else if ($this->person->birth_date) {
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||
);
|
||||
|
||||
@@ -94,7 +94,7 @@ class RequestLog extends Model
|
||||
"CLAIM METHOD",
|
||||
"STATUS",
|
||||
];
|
||||
|
||||
|
||||
|
||||
public static $status = [
|
||||
'draft' => 'Draft',
|
||||
@@ -241,6 +241,16 @@ class RequestLog extends Model
|
||||
return $this->belongsTo(Service::class, 'service_code', 'code');
|
||||
}
|
||||
|
||||
public function requestLogBenefit()
|
||||
{
|
||||
return $this->hasOne(RequestLogBenefit::class, 'request_log_id');
|
||||
}
|
||||
|
||||
public function requestLogDailyMonitorings()
|
||||
{
|
||||
return $this->hasMany(RequestLogDailyMonitoring::class, 'request_log_id');
|
||||
}
|
||||
|
||||
public function getPaymentTypeNameAttribute()
|
||||
{
|
||||
return self::$payment_types[$this->payment_type] ?? $this->payment_type;
|
||||
|
||||
@@ -24,7 +24,13 @@ class RequestLogBenefit extends Model
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function benefit(){
|
||||
public function benefit()
|
||||
{
|
||||
return $this->belongsTo(Benefit::class, 'benefit_id', 'id');
|
||||
}
|
||||
|
||||
public function requestLog()
|
||||
{
|
||||
return $this->belongsTo(RequestLog::class, 'aa');
|
||||
}
|
||||
}
|
||||
|
||||
21
app/Models/RequestLogDailyMonitoring.php
Normal file
21
app/Models/RequestLogDailyMonitoring.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RequestLogDailyMonitoring extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function requestLog()
|
||||
{
|
||||
return $this->belongsTo(RequestLog::class);
|
||||
}
|
||||
|
||||
public function requestLogMedicalPlans()
|
||||
{
|
||||
return $this->hasMany(RequestLogMedicalPlan::class);
|
||||
}
|
||||
}
|
||||
16
app/Models/RequestLogMedicalPlan.php
Normal file
16
app/Models/RequestLogMedicalPlan.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RequestLogMedicalPlan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function requestLogDailyMonitoring()
|
||||
{
|
||||
return $this->belongsTo(RequestLogDailyMonitoring::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user