fix sql statement

This commit is contained in:
Jean-Christian Paul Denis 2023-04-23 14:28:57 +02:00
parent 809606c889
commit 4a191db4eb
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -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;
}