Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
bbabb84a
Commit
bbabb84a
authored
Jul 06, 2016
by
andre
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'blog-hashtag-filtr'
parents
81e3acc9
2dd3395f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
34 deletions
+3
-34
common/components/UrlManager.php
common/components/UrlManager.php
+3
-1
common/modules/blog/controllers/PostController.php
common/modules/blog/controllers/PostController.php
+0
-33
No files found.
common/components/UrlManager.php
View file @
bbabb84a
...
@@ -15,7 +15,9 @@ class UrlManager extends \yii\web\UrlManager {
...
@@ -15,7 +15,9 @@ class UrlManager extends \yii\web\UrlManager {
{
{
$rules
[
'<page:('
.
$page
->
url
.
')>'
]
=
'content/page/view'
;
$rules
[
'<page:('
.
$page
->
url
.
')>'
]
=
'content/page/view'
;
}
}
$request
->
url
=
rtrim
(
$request
->
url
,
'/'
);
$this
->
addRules
(
$rules
,
false
);
$this
->
addRules
(
$rules
,
false
);
return
parent
::
parseRequest
(
$request
);
return
parent
::
parseRequest
(
$request
);
...
...
common/modules/blog/controllers/PostController.php
View file @
bbabb84a
...
@@ -62,41 +62,8 @@ class PostController extends BaseController
...
@@ -62,41 +62,8 @@ class PostController extends BaseController
$tag
=
$this
->
getCookie
();
$tag
=
$this
->
getCookie
();
// if(count($tag))
// {
//
// '
// SELECT * FROM `posts`
// WHERE `posts`.id IN (
// SELECT `post_id`
// FROM `posts_tags_assign`
// WHERE `tag_id` IN (1,2)
// GROUP BY post_id HAVING COUNT(post_id)=2
// )
// ';
//
// $subQuery = PostTagAssign::find();
// $subQuery->where(["tag_id" => $tag]);
// $subQuery->groupBy('post_id');
// $subQuery->having(['count(post_id)' => count($tag)]);
//
// $query = Post::find()->where('posts.active=1')->limit(Post::PAGE_SIZE)->orderBy(Post::tableName().'.created_at DESC');
// $query->an
//// $query->andWhere()
//
// }
// else
// {
// $query = Post::find()->where('posts.active=1')->limit(Post::PAGE_SIZE)->orderBy(Post::tableName().'.created_at DESC');
// }
if
(
count
(
$tag
))
if
(
count
(
$tag
))
{
{
// $searchPost = new SearchPost();
// $query = $searchPost->findByTags($tag);
$query
=
Post
::
find
()
->
where
([
'active'
=>
1
])
->
orderBy
(
Post
::
tableName
()
.
'.created_at DESC'
);
$query
=
Post
::
find
()
->
where
([
'active'
=>
1
])
->
orderBy
(
Post
::
tableName
()
.
'.created_at DESC'
);
$query
=
$query
->
joinWith
(
'postTagAssigns'
)
->
andWhere
([
PostTagAssign
::
tableName
()
.
'.tag_id'
=>
$tag
]);
$query
=
$query
->
joinWith
(
'postTagAssigns'
)
->
andWhere
([
PostTagAssign
::
tableName
()
.
'.tag_id'
=>
$tag
]);
}
}
...
...
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