diff --git a/Models/WikiCategoryMapper.php b/Models/WikiCategoryMapper.php index f99a7cb..86314dc 100755 --- a/Models/WikiCategoryMapper.php +++ b/Models/WikiCategoryMapper.php @@ -112,8 +112,8 @@ final class WikiCategoryMapper extends DataMapperAbstract public static function getByParentAndApp($value, int $app = 1, int $depth = 3) : array { $query = self::getQuery(); - $query->where(static::$table . '_' . $depth . '.' . static::$parent, '=', $value) - ->andWhere(static::$table . '_' . $depth . '.wiki_category_app', '=', $app); + $query->where(static::$table . '_d' . $depth . '.' . static::$parent, '=', $value) + ->andWhere(static::$table . '_d' . $depth . '.wiki_category_app', '=', $app); return self::getAllByQuery($query, RelationType::ALL, $depth); } @@ -131,7 +131,7 @@ final class WikiCategoryMapper extends DataMapperAbstract public static function getByApp(int $app, int $depth = 3) : array { $query = self::getQuery(); - $query->where(static::$table . '_' . $depth . '.wiki_category_app', '=', $app); + $query->where(static::$table . '_d' . $depth . '.wiki_category_app', '=', $app); return self::getAllByQuery($query, RelationType::ALL, $depth); } diff --git a/Models/WikiDocMapper.php b/Models/WikiDocMapper.php index 70df0fe..c766a9c 100755 --- a/Models/WikiDocMapper.php +++ b/Models/WikiDocMapper.php @@ -113,13 +113,13 @@ final class WikiDocMapper extends DataMapperAbstract { $query ??= self::getQuery(null, [], $relations, $depth); - $query->where(static::$table . '_' . $depth . '.wiki_article_app', '=', $app) + $query->where(static::$table . '_d' . $depth . '.wiki_article_app', '=', $app) ->limit($limit); if (!empty(static::$createdAt)) { - $query->orderBy(static::$table . '_' . $depth . '.' . static::$columns[static::$createdAt]['name'], 'DESC'); + $query->orderBy(static::$table . '_d' . $depth . '.' . static::$columns[static::$createdAt]['name'], 'DESC'); } else { - $query->orderBy(static::$table . '_' . $depth . '.' . static::$columns[static::$primaryField]['name'], 'DESC'); + $query->orderBy(static::$table . '_d' . $depth . '.' . static::$columns[static::$primaryField]['name'], 'DESC'); } return self::getAllByQuery($query, $relations, $depth); diff --git a/composer.json b/composer.json index 8f2fb6d..7ad134b 100755 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ ], "require-dev": { "phpunit/phpunit": ">=9.4", - "friendsofphp/php-cs-fixer": ">=2.18", + "friendsofphp/php-cs-fixer": ">=3.0", "squizlabs/php_codesniffer": ">=3.5", "phpmd/phpmd": ">=2.9", "phpstan/phpstan": ">=0.12.58",