From 4a191db4eb8671fcc4fb1635570d2368b594b1de Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 23 Apr 2023 14:28:57 +0200 Subject: [PATCH] fix sql statement --- src/FrontendBehaviors.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FrontendBehaviors.php b/src/FrontendBehaviors.php index bb7f5ae..0a6b893 100644 --- a/src/FrontendBehaviors.php +++ b/src/FrontendBehaviors.php @@ -43,7 +43,7 @@ class FrontendBehaviors // Get expired dates and post_id $sql = new SelectStatement(); - $posts = $sql->from(dcCore::app()->prefix . dcBlog::POST_TABLE_NAME) + $posts = $sql->from($sql->as(dcCore::app()->prefix . dcBlog::POST_TABLE_NAME, 'P')) ->columns([ 'P.post_id', 'P.post_tz', @@ -61,7 +61,7 @@ class FrontendBehaviors ->select(); // No expired date - if ($posts->isEmpty()) { + if (is_null($posts) || $posts->isEmpty()) { return; }