Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb
This commit is contained in:
commit
ed9165590c
@ -348,4 +348,34 @@ class TempToolsController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
public function exportLock()
|
||||
{
|
||||
$type = getReqVal('type', '0');
|
||||
$mysql_conf = getMysqlConfig(crc32(''));
|
||||
if (SERVER_ENV == _ONLINE) {
|
||||
$mysql_conf['database'] = 'bcevent_prod_1';
|
||||
} else {
|
||||
$mysql_conf['database'] = 'bcevent_dev';
|
||||
}
|
||||
$conn = new phpcommon\Mysql(array(
|
||||
'host' => $mysql_conf['host'],
|
||||
'port' => $mysql_conf['port'],
|
||||
'user' => $mysql_conf['user'],
|
||||
'passwd' => $mysql_conf['passwd'],
|
||||
'dbname' => $mysql_conf['database'],
|
||||
));
|
||||
if ($type == 0) {
|
||||
$sql = 'select lock_to, count(idx) as lock_count from t_nft_lock_event group by lock_to;';
|
||||
} else {
|
||||
$nowDayseconds = myself()->_getNowDaySeconds();
|
||||
$beginTime = $nowDayseconds;
|
||||
$endTime = $nowDayseconds + 3600 *24;
|
||||
$sql = "select lock_to, count(idx) as lock_count from t_nft_lock_event where createtime>=$beginTime and createtime<=$endTime group by lock_to;";
|
||||
}
|
||||
$rows = $conn->execQuery($sql);
|
||||
foreach ($rows as $row) {
|
||||
echo $row['lock_to'] . ',' . $row['lock_count'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user