improvement uat 1

This commit is contained in:
2023-11-14 13:57:33 +07:00
parent 7284354f47
commit c5e103fc57
18 changed files with 229 additions and 130 deletions

View File

@@ -148,18 +148,35 @@ class Member extends Model
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
}
public function currentPlan()
public function currentPlans()
{
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
// ->latest(); // TODO Fix This
}
public function currentPlan()
{
return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id', )
->latest();
// ->where('plans.service_code', $this->claimRequest->service_code); // TODO Fix This
}
// public function currentPlan()
// {
// return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id')
// ->latest(); // TODO Fix This
// return $this->hasOneThrough(
// Plan::class,
// MemberPlan::class,
// 'member_id',
// 'id',
// 'id',
// 'plan_id'
// )
// ->join('claim_requests', 'claim_requests.service_code', '=', 'plans.service_code')
// ->latest('claim_requests.created_at') // Atau sesuaikan dengan kolom timestamp yang sesuai
// ->select('plans.*');
// }
public function currentEmployeds()
{
return $this->hasOneThrough(CorporateEmployee::class, Person::class, 'nik', 'id', 'id', 'nik')