fix dashboard table
This commit is contained in:
@@ -44,10 +44,10 @@ class Corporate extends Model
|
||||
public function currentPolicy()
|
||||
{
|
||||
return $this->hasOne(CorporatePolicy::class)
|
||||
// ->where('start', '<=', now())
|
||||
// ->where('end', '>=', now())
|
||||
->where('active', true)
|
||||
->latestOfMany();
|
||||
// ->where('start', '<=', now())
|
||||
// ->where('end', '>=', now())
|
||||
->where('active', true)
|
||||
->latestOfMany();
|
||||
}
|
||||
|
||||
public function corporatePlans()
|
||||
|
||||
@@ -19,4 +19,9 @@ class CorporateEmployee extends Model
|
||||
'nik',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function division()
|
||||
{
|
||||
return $this->belongsTo(CorporateDivision::class, 'division_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,4 +182,14 @@ class Member extends Model
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
// public function corporateEmployee()
|
||||
// {
|
||||
// return $this->hasOne(CorporateEmployee::class, 'member_id');
|
||||
// }
|
||||
|
||||
public function division()
|
||||
{
|
||||
return $this->hasOneThrough(CorporateDivision::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'division_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user