Skip to content

Commit 00a95b2

Browse files
committed
use connection in db reorder
1 parent 9050d81 commit 00a95b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/Library/CrudPanel/Traits/Reorder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function updateTreeOrder($request)
4747
});
4848

4949
// wrap the queries in a transaction to avoid partial updates
50-
DB::transaction(function () use ($reorderItems, $primaryKey, $itemKeys) {
50+
DB::connection($this->model->getConnectionName())->transaction(function () use ($reorderItems, $primaryKey, $itemKeys) {
5151
// create a string of ?,?,?,? to use as bind placeholders for item keys
5252
$reorderItemsBindString = implode(',', array_fill(0, count($reorderItems), '?'));
5353

@@ -68,7 +68,7 @@ public function updateTreeOrder($request)
6868
// add the where clause to the query to help match the items
6969
$query .= "ELSE {$column} END WHERE {$primaryKey} IN ({$reorderItemsBindString})";
7070

71-
DB::statement($query, $bindings);
71+
DB::connection($this->model->getConnectionName())->statement($query, $bindings);
7272
}
7373
});
7474

0 commit comments

Comments
 (0)