DONE: settle disable vote for voter with saham under 500, fix issue on...
This commit is contained in:
@@ -45,6 +45,13 @@ class GetController extends Controller
|
||||
->where('allowance_payouts.status', 'paid');
|
||||
}, 'cash_payout_id');
|
||||
|
||||
// Latest paid cash payout — Rujukan / Nota for admin allowance modal ($electionId bound as int)
|
||||
$eid = (int) $electionId;
|
||||
$q->addSelect([
|
||||
DB::raw("(SELECT ap.reference FROM allowance_payouts ap WHERE ap.voter_id = voter.id AND ap.election_id = {$eid} AND ap.method = 'cash' AND ap.status = 'paid' ORDER BY ap.id DESC LIMIT 1) as cash_payout_reference"),
|
||||
DB::raw("(SELECT ap.note FROM allowance_payouts ap WHERE ap.voter_id = voter.id AND ap.election_id = {$eid} AND ap.method = 'cash' AND ap.status = 'paid' ORDER BY ap.id DESC LIMIT 1) as cash_payout_note"),
|
||||
]);
|
||||
|
||||
$q->selectSub(function ($sq) use ($electionId) {
|
||||
$sq->from('allowance_payouts')
|
||||
->selectRaw('MAX(paid_at)')
|
||||
|
||||
Reference in New Issue
Block a user