-
-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Refs https://github.com/composer/packagist/pull/1232/files
public function getDependents(string $name, int $offset = 0, int $limit = 15, string $orderBy = 'name', ?int $type = null)
{
$orderByField = 'p.name ASC';
$join = '';
if ($orderBy === 'downloads') {
$orderByField = 'd.total DESC';
$join = 'LEFT JOIN download d ON d.id = p.id AND d.type = '.Download::TYPE_PACKAGE;
} else {
$orderBy = 'name';
}
$args = ['name' => $name];
$typeFilter = '';
if (null !== $type) {
$typeFilter = ' AND type = :type';
$args['type'] = $type;
}
$sql = 'SELECT p.id, p.name, p.description, p.language, p.abandoned, p.replacementPackage
FROM package p INNER JOIN (
SELECT DISTINCT package_id FROM dependent WHERE packageName = :name'.$typeFilter.'
) x ON x.package_id = p.id '.$join.' ORDER BY '.$orderByField.' LIMIT '.((int)$limit).' OFFSET '.((int)$offset);
return $this->getEntityManager()->getConnection()->fetchAllAssociative($sql, $args);
}leads to
Query error: Unknown column 'd.total' in 'order clause' (1054).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working