|
@@ -53,11 +53,13 @@ class IndexController extends Controller
|
|
{
|
|
{
|
|
$count = max(min(intval($count), 500), 1);
|
|
$count = max(min(intval($count), 500), 1);
|
|
$list = [];
|
|
$list = [];
|
|
|
|
+ $updates = [];
|
|
while ($count--) {
|
|
while ($count--) {
|
|
$row = World::repeatStatement()->find(mt_rand(1, 10000));
|
|
$row = World::repeatStatement()->find(mt_rand(1, 10000));
|
|
$list[] = $row;
|
|
$list[] = $row;
|
|
- $row->repeatStatement()->update(['randomNumber' => mt_rand(1, 10000)]);
|
|
|
|
|
|
+ $updates[] = 'update world set randomNumber='.mt_rand(1, 10000).' where id='.$row->id;
|
|
}
|
|
}
|
|
|
|
+ $row->exec(implode(';',$updates));
|
|
return $this->json($list);
|
|
return $this->json($list);
|
|
}
|
|
}
|
|
|
|
|