skor petani
This commit is contained in:
@@ -50,7 +50,7 @@ class AksesPasar extends Model
|
||||
static::saved(function (AksesPasar $aksesPasar) {
|
||||
|
||||
$petani = Petani::find($aksesPasar->petani_id);
|
||||
$skor = SkorPetani::where('petani_id')->orderBy('id')->first();
|
||||
$skor = SkorPetani::where('petani_id', $petani->id)->orderBy('id')->first();
|
||||
if (!$skor) {
|
||||
$petaniUid = $petani->uid;
|
||||
$part = explode('-', $petaniUid);
|
||||
@@ -61,6 +61,7 @@ class AksesPasar extends Model
|
||||
'updated_by' => $petani->updated_by
|
||||
]);
|
||||
}
|
||||
|
||||
$skor->update([
|
||||
'skor_d6_k1_6_pengalaman_menjual_ke_saluran_berbeda' => $aksesPasar->skor_pengalaman,
|
||||
'skor_d6_k4_1_kesadaran_akses_pasar_premium' => $aksesPasar->skor_kesadaran_premium,
|
||||
|
||||
Reference in New Issue
Block a user