Skip to content

Commit 3eba5ac

Browse files
authored
use transaction (#6822)
* use transaction * d
1 parent df69255 commit 3eba5ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

frameworks/PHP/one/App/Controllers/IndexController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ public function updates($count = 1)
5858
$row->randomNumber = mt_rand(1, 10000);
5959
$list[] = $row;
6060
}
61+
//
62+
World::beginTransaction();
6163
foreach($list as $r){
6264
$r->repeatStatement()->update(['randomNumber' => $r->randomNumber]);
6365
}
66+
World::commit();
6467
return $this->json($list);
6568
}
6669

0 commit comments

Comments
 (0)