diff --git a/framework/core/src/Post/Post.php b/framework/core/src/Post/Post.php index daa4f5959..65c18c6ee 100644 --- a/framework/core/src/Post/Post.php +++ b/framework/core/src/Post/Post.php @@ -96,9 +96,9 @@ class Post extends AbstractModel /** @var ConnectionInterface $db */ $db = static::getConnectionResolver(); - $post->number = new Expression('('. $db + $post->number = new Expression('('.$db ->table('posts', 'pn') - ->whereRaw('pn.discussion_id = ' . intval($post->discussion_id)) + ->whereRaw('pn.discussion_id = '.intval($post->discussion_id)) ->select($db->raw('max(pn.number) + 1')) ->toSql() .')');