How can I get a list of posts by the following principle:
Get by post creation date created_at
. But if post_top_date
is not equal to the steering wheel, take the date from this column. This is the date of raising the post above all.
post_top_date
= dateTime column
This method is currently being used. But it doesn't work correctly.
PostModel::where('status', 1)
->where('moderation','=', 0)
->where('category_id', '=', $this_category_id)
->orderBy('created_at')->paginate($ElPerPageCategory);