mirror of
https://github.com/claradex/nativegallery.git
synced 2025-02-23 12:12:11 +03:00
Update ExecContests.php
This commit is contained in:
parent
c31617fd10
commit
303d70d1a3
1 changed files with 2 additions and 1 deletions
|
@ -62,6 +62,7 @@ class ExecContests
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contest['closepretendsdate'] <= time() && $contest['opendate'] <= time()) {
|
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']]);
|
DB::query('UPDATE contests SET status = 2 WHERE id = :id', [':id' => $contest['id']]);
|
||||||
echo "[{$contest['id']}] Closed for pretends.\n";
|
echo "[{$contest['id']}] Closed for pretends.\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -132,7 +133,7 @@ class ExecContests
|
||||||
'place' => $place
|
'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'],
|
':id' => $vote['photo_id'],
|
||||||
':content' => json_encode($photoData)
|
':content' => json_encode($photoData)
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue