Aplikasi kehadiran KTM ambil peti undi (SPR 2026)
Sistem untuk admin DUN merekod waktu KTM (Ketua Tempat Mengundi) hadir mengambil peti undi. Data KTM dibaca daripada DB sppm (spr2026) melalui connection kedua — hanya penempatan berjawatan KTM yang dipaparkan. - Dashboard: senarai KTM ikut pusat mengundi (asc) & saluran (asc), status BELUM HADIR (merah) / HADIR (hijau) + tarikh & masa - Carian nama/no. KP, tapisan pusat mengundi & status - Tanda hadir / batal dengan kawalan DUN (admin terhad ke DUN sendiri) - Eksport Excel (worksheet Hadir & Belum Hadir) guna SimpleXlsx - Peranan: superadmin (urus pengguna, semua DUN) & admin DUN - Docker: nginx + php-fpm + queue + scheduler + webhook deploy, port 127.0.0.1:8009, TZ Asia/Kuala_Lumpur di semua container - Zon waktu aplikasi: Asia/Kuala_Lumpur (APP_TIMEZONE) Berasaskan scaffold spr2026_taklimat. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
49
app/Models/Sppm/PetugasAssignment.php
Normal file
49
app/Models/Sppm/PetugasAssignment.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Sppm;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PetugasAssignment extends Model
|
||||
{
|
||||
protected $connection = 'sppm';
|
||||
protected $table = 'petugas_assignments';
|
||||
protected $guarded = [];
|
||||
|
||||
public function permohonan(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PetugasPermohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
public function pusatMengundi(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PusatMengundi::class, 'pusat_mengundi_id');
|
||||
}
|
||||
|
||||
public function saluran(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Saluran::class, 'saluran_id');
|
||||
}
|
||||
|
||||
public function jawatan(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(JawatanTetapan::class, 'jawatan_tetapan_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Penempatan KTM (Ketua Tempat Mengundi) sahaja.
|
||||
*/
|
||||
public function scopeKtm($query)
|
||||
{
|
||||
return $query->whereHas('jawatan', fn ($q) => $q->where('kod', 'KTM'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Penempatan dalam DUN tertentu (melalui pusat mengundi penempatan).
|
||||
*/
|
||||
public function scopeUntukDun($query, int $dunId)
|
||||
{
|
||||
return $query->whereHas('pusatMengundi', fn ($q) => $q->where('dun_id', $dunId));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user