Skip to content

Commit

Permalink
fix(pages): Only pull published pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zooley committed Sep 24, 2024
1 parent c87fae2 commit 02d124a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/Modules/Pages/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,17 @@ public static function stackByPath(string $path): Collection
->whereRaw('n.lft BETWEEN p.lft AND p.rgt')
->where('n.path', '=', (string) $path)
->whereNull('p.deleted_at')
->where('p.state', '=', 1)
->where(function ($where)
{
$where->whereNull('p.publish_up')
->orWhere('p.publish_up', '<=', Carbon::now()->toDateTimeString());
})
->where(function ($where)
{
$where->whereNull('p.publish_down')
->orWhere('p.publish_down', '>', Carbon::now()->toDateTimeString());
})
->orderBy('p.lft', 'asc')
->get();
}
Expand Down

0 comments on commit 02d124a

Please sign in to comment.