Skip to content

Commit 3756fdb

Browse files
committed
fix styleci and update test
1 parent 70db357 commit 3756fdb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/LaravelSubQuery.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ public function orderByRelation($relations, $orderType = 'desc', $type = 'max')
6666
$type = $relations[1];
6767
unset($relations[0], $relations[1]);
6868
}
69-
if (!strpos($relations, ':')) {
69+
if (! strpos($relations, ':')) {
7070
return $this->orderBy($relations, $orderType);
7171
}
72+
7273
return $this->withSubQuery($relations, $type, $orderType);
7374
}
7475

tests/LaravelSubQueryOrderByRelationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testOrderByRelation()
3535

3636
$results = Invoice::orderByRelation(['items:price' => function (Builder $query) {
3737
$query->where('price', '<', 6);
38-
}, 'max', 'desc'])->get();
38+
}, 'desc', 'max'])->get();
3939
$this->assertEquals([['id' => 1, 'name' => 'text_name', 'items_price_max' => 5]], $results->toArray());
4040

4141
$results = Invoice::orderByRelation('goods:price')->get();

0 commit comments

Comments
 (0)