-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blog helper test categories #3029
Blog helper test categories #3029
Conversation
@ryuring |
一旦、担当を戻しておきますね @nghiem-mb |
@@ -424,6 +425,7 @@ public function test__getCategoryList() | |||
'fields' => $fields, | |||
'depth' => 2, | |||
]); | |||
// dd($result->toArray()[0]->children); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nghiem-mb 削除必要
@@ -268,6 +268,7 @@ protected function _getCategoryList( | |||
if ($distinct) { | |||
$query->distinct($distinct); | |||
} | |||
$query->matching('BlogPosts.BlogContents.Contents'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nghiem-mb これは使い方が違う気がします。全ての条件において無理やり inner join で繋げることになり負荷が高くなるので、必要な時だけ使うように調整してください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
はい。調整します。
@@ -268,6 +268,9 @@ protected function _getCategoryList( | |||
if ($distinct) { | |||
$query->distinct($distinct); | |||
} | |||
if ($options['siteId'] !== false && !is_null($options['siteId'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nghiem-mb 238行目にまとめることはできませんか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nghiem-mb 以前共有したこちらのコードを参考にお願いします。
$query->matching('BlogPosts.BlogContents.Contents', function ($q) use ($params) {
return $q->where(['Contents.site_id' => $params['siteId']]);
});
No description provided.