Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
onestartup-blog
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Angel Martin
onestartup-blog
Commits
a5200915
Commit
a5200915
authored
6 years ago
by
Angel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Orden de las entradas
parent
9f34fce0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
BlogController.php
src/controllers/BlogController.php
+3
-3
No files found.
src/controllers/BlogController.php
View file @
a5200915
...
...
@@ -17,17 +17,17 @@ class BlogController extends Controller
{
if
(
isset
(
$request
->
category
)){
$category
=
Category
::
where
(
'slug'
,
$request
->
category
)
->
first
();
$posts
=
$category
->
entries
()
->
where
(
'status'
,
1
)
->
orderBy
(
'publication_date'
,
'
a
sc'
)
->
paginate
(
config
(
"blog.blog-index.post-pagination"
));
$posts
=
$category
->
entries
()
->
where
(
'status'
,
1
)
->
orderBy
(
'publication_date'
,
'
de
sc'
)
->
paginate
(
config
(
"blog.blog-index.post-pagination"
));
}
elseif
(
isset
(
$request
->
tags
))
{
$tags
=
explode
(
","
,
$request
->
tags
);
$posts
=
Entry
::
where
(
'status'
,
1
)
->
where
(
function
(
$query
)
use
(
$tags
)
{
for
(
$i
=
0
;
$i
<
count
(
$tags
);
$i
++
){
$query
->
orwhere
(
'tags'
,
'like'
,
'%'
.
$tags
[
$i
]
.
'%'
);
}
})
->
orderBy
(
'publication_date'
,
'
a
sc'
)
->
paginate
(
config
(
"blog.blog-index.post-pagination"
));
})
->
orderBy
(
'publication_date'
,
'
de
sc'
)
->
paginate
(
config
(
"blog.blog-index.post-pagination"
));
}
else
{
$posts
=
Entry
::
where
(
'status'
,
1
)
->
orderBy
(
'publication_date'
,
'
a
sc'
)
->
paginate
(
config
(
"blog.blog-index.post-pagination"
));
$posts
=
Entry
::
where
(
'status'
,
1
)
->
orderBy
(
'publication_date'
,
'
de
sc'
)
->
paginate
(
config
(
"blog.blog-index.post-pagination"
));
}
$otros
=
Entry
::
where
(
'status'
,
1
)
->
inRandomOrder
()
->
take
(
config
(
"blog.blog-index.otros"
))
->
get
();
$categories
=
Category
::
where
(
'active'
,
1
)
->
get
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment