update skoring
This commit is contained in:
@@ -163,7 +163,7 @@ class Petani extends Model
|
||||
return null;
|
||||
}
|
||||
|
||||
return round($nilai->sum(fn ($value) => (int) $value) * 0.1, 1);
|
||||
return round($nilai->sum(fn ($value) => (int) $value) * 0.2, 1);
|
||||
}
|
||||
|
||||
public function skorPendidikan(): ?float
|
||||
@@ -242,10 +242,10 @@ class Petani extends Model
|
||||
return null;
|
||||
}
|
||||
|
||||
$nilai = collect([
|
||||
$aksesPasar->skor_pengalaman,
|
||||
$aksesPasar->skor_kesadaran_premium,
|
||||
])->filter(fn ($value) => !is_null($value) && $value !== '');
|
||||
$nilai = collect(Schema::getColumnListing($aksesPasar->getTable()))
|
||||
->filter(fn ($field) => str_starts_with($field, 'skor_'))
|
||||
->map(fn ($field) => $aksesPasar->getAttribute($field))
|
||||
->filter(fn ($value) => !is_null($value) && $value !== '');
|
||||
|
||||
if ($nilai->isEmpty()) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user