|
@@ -13,8 +13,8 @@ class KuController extends AppController
|
|
|
|
|
|
public function index()
|
|
public function index()
|
|
{
|
|
{
|
|
- KuRaw::$db->execute([mt_rand(1, 10000)]);
|
|
|
|
- echo json_encode(KuRaw::$db->fetch());
|
|
|
|
|
|
+ KuRaw::$random->execute([mt_rand(1, 10000)]);
|
|
|
|
+ echo json_encode(KuRaw::$random->fetch());
|
|
}
|
|
}
|
|
|
|
|
|
public function query($count = 1)
|
|
public function query($count = 1)
|
|
@@ -22,8 +22,8 @@ class KuController extends AppController
|
|
$count = min(max((int) $count, 1), 500);
|
|
$count = min(max((int) $count, 1), 500);
|
|
|
|
|
|
while ($count--) {
|
|
while ($count--) {
|
|
- KuRaw::$db->execute([mt_rand(1, 10000)]);
|
|
|
|
- $worlds[] = KuRaw::$db->fetch();
|
|
|
|
|
|
+ KuRaw::$random->execute([mt_rand(1, 10000)]);
|
|
|
|
+ $worlds[] = KuRaw::$random->fetch();
|
|
}
|
|
}
|
|
echo json_encode($worlds);
|
|
echo json_encode($worlds);
|
|
}
|
|
}
|
|
@@ -33,14 +33,14 @@ class KuController extends AppController
|
|
$count = min(max((int) $count, 1), 500);
|
|
$count = min(max((int) $count, 1), 500);
|
|
|
|
|
|
while ($count--) {
|
|
while ($count--) {
|
|
- $id = mt_rand(1, 10000);
|
|
|
|
|
|
|
|
- KuRaw::$random->execute([$id]);
|
|
|
|
- $row = ['id' => $id, 'randomNumber' => KuRaw::$random->fetchColumn()];
|
|
|
|
|
|
+ KuRaw::$random->execute([mt_rand(1, 10000)]);
|
|
|
|
+ $row = KuRaw::$random->fetch();
|
|
$row['randomNumber'] = mt_rand(1, 10000);
|
|
$row['randomNumber'] = mt_rand(1, 10000);
|
|
|
|
|
|
$worlds[] = $row;
|
|
$worlds[] = $row;
|
|
}
|
|
}
|
|
|
|
+
|
|
KuRaw::update($worlds);
|
|
KuRaw::update($worlds);
|
|
|
|
|
|
echo json_encode($worlds);
|
|
echo json_encode($worlds);
|