Fix Member Import
This commit is contained in:
@@ -29,7 +29,29 @@ class Member extends Model
|
||||
"active",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"deleted_by"
|
||||
"deleted_by",
|
||||
|
||||
"nric",
|
||||
"email",
|
||||
"bank_info",
|
||||
"agent_code",
|
||||
"address1",
|
||||
"address2",
|
||||
"address3",
|
||||
"address4",
|
||||
"city",
|
||||
"state",
|
||||
"postal_code",
|
||||
"passport_no",
|
||||
"passport_country",
|
||||
"identification_code",
|
||||
"pre_existing",
|
||||
"bpjs_id",
|
||||
"endorsement_date",
|
||||
"remarks",
|
||||
"policy_in_force",
|
||||
"start_no_claim",
|
||||
"end_no_claim",
|
||||
];
|
||||
|
||||
public static $doc_headers_to_field_map = [
|
||||
@@ -109,6 +131,11 @@ class Member extends Model
|
||||
return $this->hasMany(MemberPolicy::class, 'member_id', 'member_id');
|
||||
}
|
||||
|
||||
public function currentPolicy()
|
||||
{
|
||||
return $this->hasOne(MemberPolicy::class, 'member_id', 'member_id')->where('status', 'active')->latestOfMany();
|
||||
}
|
||||
|
||||
public function scopeFilter($query, array $filters)
|
||||
{
|
||||
$query->when($filters['search'] ?? false, function ($query, $search) {
|
||||
|
||||
Reference in New Issue
Block a user