<?php
|
|
include_once "../../../Common/CommFunc.php";
|
include_once "../../../Common/Logging.php";
|
include_once '../../../Common/MongoDB7.php';
|
|
\Logging\CreateLogging("queryWorldRankTestData.php");
|
|
$count = $_GET['count'];
|
$datas = [];
|
for ($i = 1; $i <= $count; $i++) {
|
array_push($datas, array(
|
"openid" => "testopenid" . $i,
|
"nickName" => "测试玩家" . $i,
|
"weekScore" => 5,
|
"highestScore" => 6,
|
"missionNum" => 7,
|
"city" => "test",
|
));
|
}
|
|
if (!$datas) {
|
echo "no insert data!";
|
return;
|
}
|
|
$gamename = "mandown";
|
$gameconfig = parse_ini_file("config/" . $gamename . ".ini", true);
|
$dbOpt = new \MongoDB7\MongoDb("Player", $gameconfig["db"]);
|
$delCount = $dbOpt->delete(['city' => 'test'], 0);
|
echo "delCount: " . $delCount . "<br/>";
|
|
$dbOpt = new \MongoDB7\MongoDb("Player", $gameconfig["db"]);
|
$insCount = $dbOpt->insertbatch($datas);
|
echo "insCount: " . $insCount . "<br/>";
|
echo time();
|