|
|
@ -13,6 +13,7 @@ use think\Db;
|
|
|
|
use Base\Task\Task;
|
|
|
|
use Base\Task\Task;
|
|
|
|
use Base\Service\MarketService;
|
|
|
|
use Base\Service\MarketService;
|
|
|
|
use Base\Tool\AggregateClient;
|
|
|
|
use Base\Tool\AggregateClient;
|
|
|
|
|
|
|
|
use Base\Repository\GameRepository;
|
|
|
|
|
|
|
|
|
|
|
|
class ConsoleController extends Think {
|
|
|
|
class ConsoleController extends Think {
|
|
|
|
|
|
|
|
|
|
|
@ -600,7 +601,7 @@ class ConsoleController extends Think {
|
|
|
|
// ARPU (当日充值金额/当日活跃用户数)
|
|
|
|
// ARPU (当日充值金额/当日活跃用户数)
|
|
|
|
// ARRPU (当日充值金额/当日充值用户数)
|
|
|
|
// ARRPU (当日充值金额/当日充值用户数)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function checkAndfreezeTestingUser()
|
|
|
|
public function checkAndfreezeTestingUser()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$pageCount = 100;
|
|
|
|
$pageCount = 100;
|
|
|
@ -635,8 +636,34 @@ class ConsoleController extends Think {
|
|
|
|
} while($hasNext);
|
|
|
|
} while($hasNext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testIp()
|
|
|
|
public function statUserRetention()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var_dump(\Base\Tool\IPTool::getIpInfo('120.35.40.249'));
|
|
|
|
$begin = I('begin', date('Y-m-d'));
|
|
|
|
|
|
|
|
$end = I('end', date('Y-m-d'));
|
|
|
|
|
|
|
|
$baseGameId = I('base_game_id', 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$repository = new GameRepository();
|
|
|
|
|
|
|
|
$baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$beginDate = strtotime($begin);
|
|
|
|
|
|
|
|
$endDate = strtotime($end);
|
|
|
|
|
|
|
|
$dayTime = 24 * 3600;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$trs = '';
|
|
|
|
|
|
|
|
for ($date = $beginDate; $date <= $endDate; $date = $date + $dayTime) {
|
|
|
|
|
|
|
|
$dateStr = date('Y-m-d', $date);
|
|
|
|
|
|
|
|
$userRegisterCount = $repository->getUserRegisterCount($baseGame, $dateStr);
|
|
|
|
|
|
|
|
$userRetentionCount60 = $repository->getUserRetentionCount($baseGame, $dateStr, 60);
|
|
|
|
|
|
|
|
$userRetentionCount90 = $repository->getUserRetentionCount($baseGame, $dateStr, 90);
|
|
|
|
|
|
|
|
$trs .= '<tr>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '<td>' . $dateStr . '</td>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '<td>' . $userRegisterCount . '</td>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '<td>' . $userRetentionCount60 . '</td>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '<td>' . $userRetentionCount90 . '</td>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '<td>' . round($userRetentionCount60 / $userRegisterCount * 100, 2) . '%' . '</td>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '<td>' . round($userRetentionCount90 / $userRegisterCount * 100, 2) . '%' . '</td>' . PHP_EOL;
|
|
|
|
|
|
|
|
$trs .= '</tr>'. PHP_EOL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<table>' . PHP_EOL . $trs . '</table>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|