Use selectAlias()
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
20f8d1094a
commit
a5b0308713
|
@ -64,7 +64,9 @@ class RepairInvalidPaths implements IRepairStep {
|
||||||
);
|
);
|
||||||
|
|
||||||
//select f.path, f.parent,p.path from oc_filecache f inner join oc_filecache p on f.parent=p.fileid and p.path!='' where f.path != p.path || '/' || f.name;
|
//select f.path, f.parent,p.path from oc_filecache f inner join oc_filecache p on f.parent=p.fileid and p.path!='' where f.path != p.path || '/' || f.name;
|
||||||
$query = $builder->select('f.fileid', 'f.path', 'p.path AS parent_path', 'f.name', 'f.parent', 'f.storage', 'p.storage as parent_storage')
|
$builder->select('f.fileid', 'f.path', 'f.name', 'f.parent', 'f.storage')
|
||||||
|
->selectAlias('p.path', 'parent_path')
|
||||||
|
->selectAlias('p.storage', 'parent_storage')
|
||||||
->from('filecache', 'f')
|
->from('filecache', 'f')
|
||||||
->innerJoin('f', 'filecache', 'p', $builder->expr()->andX(
|
->innerJoin('f', 'filecache', 'p', $builder->expr()->andX(
|
||||||
$builder->expr()->eq('f.parent', 'p.fileid'),
|
$builder->expr()->eq('f.parent', 'p.fileid'),
|
||||||
|
@ -74,7 +76,7 @@ class RepairInvalidPaths implements IRepairStep {
|
||||||
->setMaxResults(self::MAX_ROWS);
|
->setMaxResults(self::MAX_ROWS);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$result = $query->execute();
|
$result = $builder->execute();
|
||||||
$rows = $result->fetchAll();
|
$rows = $result->fetchAll();
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
yield $row;
|
yield $row;
|
||||||
|
|
Loading…
Reference in New Issue