[WIP] Claim

This commit is contained in:
R
2022-12-08 12:26:29 +07:00
parent 7d8a60f207
commit 32efc28043
7 changed files with 217 additions and 29 deletions

View File

@@ -99,17 +99,24 @@ class Member extends Model
public function currentCorporate()
{
return $this->belongsToMany(Corporate::class, 'corporate_employees', 'corporate_id', 'member_id')
// ->withPivot([
// 'branch_code',
// 'divison_id',
// 'nik',
// 'status',
// 'start',
// 'end'
// ])
->where('start', '<', now())
->where('end', '>', now());
// return $this->belongsToMany(Corporate::class, 'corporate_employees', 'corporate_id', 'member_id')
// // ->withPivot([
// // 'branch_code',
// // 'divison_id',
// // 'nik',
// // 'status',
// // 'start',
// // 'end'
// // ])
// ->where('start', '<', now())
// ->where('end', '>', now());
return $this->hasOneThrough(Corporate::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'corporate_id');
// ->where('corporate_policies.start', '<', now())
// ->where('corporate_policies.end', '>', now())
// ->where('member_policies.start', '<', now())
// ->where('member_policies.end', '>', now());
}
public function memberPlans()