Improved indexes, avoiding SQL errors, improving speed

This commit is contained in:
Michael 2021-02-20 20:07:25 +00:00
parent d2360d14ed
commit 92a8a399de
8 changed files with 43 additions and 75 deletions

View file

@ -315,13 +315,13 @@ class Community extends BaseModule
{
if (self::$content == 'local') {
if (!is_null(self::$accountType)) {
$condition = ["`wall` AND `origin` AND `private` = ? AND `owner`.`contact-type` = ?", Item::PUBLIC, self::$accountType];
$condition = ["`wall` AND `origin` AND `private` = ? AND `owner-contact-type` = ?", Item::PUBLIC, self::$accountType];
} else {
$condition = ["`wall` AND `origin` AND `private` = ?", Item::PUBLIC];
}
} elseif (self::$content == 'global') {
if (!is_null(self::$accountType)) {
$condition = ["`uid` = ? AND `private` = ? AND `owner`.`contact-type` = ?", 0, Item::PUBLIC, self::$accountType];
$condition = ["`uid` = ? AND `private` = ? AND `owner-contact-type` = ?", 0, Item::PUBLIC, self::$accountType];
} else {
$condition = ["`uid` = ? AND `private` = ?", 0, Item::PUBLIC];
}