Update Kelompok Tani & APP AGERA
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Pertanian;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AsetKelompokTani extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'survey_aset_kelompok_tani';
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'survey_kelompok_tani_id',
|
||||
'jenis_aset',
|
||||
'status_aset',
|
||||
'status_pengelolaan_aset',
|
||||
'kondisi_aset',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'status_aset' => 'boolean',
|
||||
];
|
||||
|
||||
public function kelompokTani(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(KelompokTani::class, 'survey_kelompok_tani_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Pertanian;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class BantuanKelompokTani extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'survey_bantuan_kelompok_tani';
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'survey_kelompok_tani_id',
|
||||
'nama_program',
|
||||
'penyelenggara',
|
||||
'bentuk_bantuan',
|
||||
'tahun',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function kelompokTani(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(KelompokTani::class, 'survey_kelompok_tani_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Pertanian;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
use App\Models\Wilayah\DesaKelurahan;
|
||||
|
||||
class KelompokTani extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'survey_kelompok_tani';
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
|
||||
// Data Responden
|
||||
'nama_responden',
|
||||
'jabatan_responden',
|
||||
'kontak_responden',
|
||||
|
||||
// Identitas Kelompok Tani
|
||||
'nama_kelompok',
|
||||
'desa_kelurahan_id',
|
||||
'dusun',
|
||||
'tahun_berdiri',
|
||||
'jenis_kelompok',
|
||||
'nama_gapoktan',
|
||||
'komoditas_id',
|
||||
|
||||
// Pengurus & Anggota Kelompok
|
||||
'jumlah_pengurus',
|
||||
'jumlah_pengurus_aktif',
|
||||
'jumlah_anggota_terdaftar',
|
||||
'jumlah_anggota_aktif',
|
||||
'jumlah_pengurus_laki_laki',
|
||||
'jumlah_pengurus_perempuan',
|
||||
'jumlah_anggota_laki_laki',
|
||||
'jumlah_anggota_perempuan',
|
||||
'jumlah_anggota_pemuda_laki_laki',
|
||||
'jumlah_anggota_pemuda_perempuan',
|
||||
|
||||
// Cakupan Wilayah Kelompok
|
||||
'cakupan_wilayah',
|
||||
'nama_wilayah_cakupan',
|
||||
|
||||
// Status Legalitas Kelompok
|
||||
'status_legalitas',
|
||||
'nomor_sk',
|
||||
'tanggal_tahun_penerbitan_sk',
|
||||
|
||||
// Kualitas Kepemimpinan
|
||||
'tingkat_keaktifan_ketua',
|
||||
'status_pembagian_peran',
|
||||
'status_dokumentasi_rapat',
|
||||
|
||||
// Frekuensi Pertemuan Rutin
|
||||
'frekuensi_pertemuan',
|
||||
'tanggal_pertemuan_terakhir',
|
||||
|
||||
// Kegiatan Konkret yang Sudah Berjalan
|
||||
'kegiatan_terlaksana',
|
||||
'estimasi_panen_minimal',
|
||||
'estimasi_panen_maksimal',
|
||||
'satuan_hasil_panen',
|
||||
'tindakan_hasil_panen',
|
||||
|
||||
// Peran & Fungsi Kelompok
|
||||
'fungsi_kelompok_bagi_anggota',
|
||||
|
||||
// Kapasitas Pengelolaan Kas/Simpan Pinjam
|
||||
'pembukuan_kas',
|
||||
'pengelola_kas',
|
||||
'masalah_pengelolaan_kas_simpan_pinjam',
|
||||
'deskripsi_masalah_pengelolaan_kas_simpan_pinjam',
|
||||
|
||||
// Keterlibatan Perempuan
|
||||
'partisipasi_perempuan',
|
||||
|
||||
// Konflik Internal
|
||||
'konflik_kelompok',
|
||||
'topik_konflik',
|
||||
'penyelesaian_konflik',
|
||||
|
||||
// Pengalaman Bantuan
|
||||
'pernah_mendapatkan_bantuan',
|
||||
|
||||
// Postensi Sebagai Mitra Agregasi/Pengolahan Kolektif
|
||||
'potensi_kelompok',
|
||||
'alasan_penilaian_potensi',
|
||||
|
||||
// Audit
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'komoditas_id' => 'array',
|
||||
'tindakan_hasil_panen' => 'array',
|
||||
'fungsi_kelompok_bagi_anggota' => 'array',
|
||||
'kegiatan_terlaksana' => 'array',
|
||||
|
||||
'pernah_mendapatkan_bantuan' => 'boolean',
|
||||
|
||||
'tanggal_pertemuan_terakhir' => 'date',
|
||||
|
||||
'estimasi_panen_minimal' => 'decimal:2',
|
||||
'estimasi_panen_maksimal' => 'decimal:2',
|
||||
];
|
||||
|
||||
public function desaKelurahan()
|
||||
{
|
||||
return $this->belongsTo(DesaKelurahan::class, 'desa_kelurahan_id');
|
||||
}
|
||||
|
||||
public function pengurus()
|
||||
{
|
||||
return $this->hasMany(PengurusKelompokTani::class, 'survey_kelompok_tani_id');
|
||||
}
|
||||
|
||||
public function aset()
|
||||
{
|
||||
return $this->hasMany(AsetKelompokTani::class, 'survey_kelompok_tani_id');
|
||||
}
|
||||
|
||||
public function bantuan()
|
||||
{
|
||||
return $this->hasMany(BantuanKelompokTani::class, 'survey_kelompok_tani_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Pertanian;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PengurusKelompokTani extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'survey_pengurus_kelompok_tani';
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'survey_kelompok_tani_id',
|
||||
'nama_pengurus',
|
||||
'jabatan',
|
||||
'kontak',
|
||||
'status',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'status' => 'boolean',
|
||||
];
|
||||
|
||||
public function kelompokTani(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(KelompokTani::class, 'survey_kelompok_tani_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user