Nonactivate a post manually causes its status changed to 3 which cannot be edited and its status cannot be changed.
This commit is contained in:
parent
3de31142e0
commit
796148a532
@ -27,7 +27,8 @@ class Posts
|
||||
$table = 'pengumuman';
|
||||
|
||||
$valid = $this->post->showAll([
|
||||
['valid_at', '<=', $now]
|
||||
['valid_at', '<=', $now],
|
||||
['status', '!=', 3]
|
||||
]);
|
||||
if ($valid !== false) {
|
||||
foreach ($valid as $fields) {
|
||||
@ -38,7 +39,8 @@ class Posts
|
||||
}
|
||||
|
||||
$not_valid = $this->post->showAll([
|
||||
['valid_at', '>', $now]
|
||||
['valid_at', '>', $now],
|
||||
['status', '!=', 3]
|
||||
]);
|
||||
if ($not_valid !== false) {
|
||||
foreach ($not_valid as $fields) {
|
||||
@ -49,7 +51,8 @@ class Posts
|
||||
}
|
||||
|
||||
$expired = $this->post->showAll([
|
||||
['expired_at', '<', $now]
|
||||
['expired_at', '<', $now],
|
||||
['status', '!=', 3]
|
||||
]);
|
||||
if ($expired !== false) {
|
||||
foreach ($expired as $fields) {
|
||||
|
@ -101,7 +101,7 @@
|
||||
<br>
|
||||
|
||||
<button type="submit"
|
||||
{% if (post.status == 0 or editor_now != creator.id) %}
|
||||
{% if (post.status == 0 or post.status == 3 or editor_now != creator.id) %}
|
||||
disabled
|
||||
{% endif %}
|
||||
>
|
||||
|
@ -176,7 +176,7 @@ abstract class Model
|
||||
$sql = "UPDATE {$table} SET status = ? WHERE id = ?";
|
||||
|
||||
$query = $db->prepare($sql);
|
||||
$query->bindValue(1, 0);
|
||||
$query->bindValue(1, 3);
|
||||
$query->bindValue(2, $id);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
Loading…
Reference in New Issue
Block a user