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:
2017-09-07 13:45:05 +07:00
parent 3de31142e0
commit 796148a532
3 changed files with 8 additions and 5 deletions

View File

@@ -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) {