From 303d70d1a37c79c4bdfb88c422f568f3ab4e50f4 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 16 Feb 2025 06:18:56 +0300 Subject: [PATCH] Update ExecContests.php --- app/Controllers/Exec/Tasks/ExecContests.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Exec/Tasks/ExecContests.php b/app/Controllers/Exec/Tasks/ExecContests.php index 67adf9c..6fc85d8 100644 --- a/app/Controllers/Exec/Tasks/ExecContests.php +++ b/app/Controllers/Exec/Tasks/ExecContests.php @@ -62,6 +62,7 @@ class ExecContests } if ($contest['closepretendsdate'] <= time() && $contest['opendate'] <= time()) { + DB::query('UPDATE photos SET on_contest=2 WHERE on_contest=1 AND contest_id=:id', array(':id'=>$contest['id'])); DB::query('UPDATE contests SET status = 2 WHERE id = :id', [':id' => $contest['id']]); echo "[{$contest['id']}] Closed for pretends.\n"; } else { @@ -132,7 +133,7 @@ class ExecContests 'place' => $place ]; - DB::query('UPDATE photos SET content = :content WHERE id = :id', [ + DB::query('UPDATE photos SET content = :content, on_contest=0, contest_id=0 WHERE id = :id', [ ':id' => $vote['photo_id'], ':content' => json_encode($photoData) ]);