1
This commit is contained in:
parent
ed9165590c
commit
92e638b93d
@ -351,19 +351,38 @@ class TempToolsController extends BaseController {
|
||||
public function exportLock()
|
||||
{
|
||||
$type = getReqVal('type', '0');
|
||||
$bceventConn = null;
|
||||
$accountConn = null;
|
||||
{
|
||||
$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(
|
||||
$bceventConn = new phpcommon\Mysql(array(
|
||||
'host' => $mysql_conf['host'],
|
||||
'port' => $mysql_conf['port'],
|
||||
'user' => $mysql_conf['user'],
|
||||
'passwd' => $mysql_conf['passwd'],
|
||||
'dbname' => $mysql_conf['database'],
|
||||
));
|
||||
}
|
||||
{
|
||||
$mysql_conf = getMysqlConfig(crc32(''));
|
||||
if (SERVER_ENV == _ONLINE) {
|
||||
$mysql_conf['database'] = 'accountdb_prod_1';
|
||||
} else {
|
||||
$mysql_conf['database'] = 'accountdb1';
|
||||
}
|
||||
$accountConn = 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 {
|
||||
@ -372,9 +391,25 @@ class TempToolsController extends BaseController {
|
||||
$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);
|
||||
$rows = $bceventConn->execQuery($sql);
|
||||
foreach ($rows as $row) {
|
||||
echo $row['lock_to'] . ',' . $row['lock_count'] . "\n";
|
||||
$email = $this->getAddressEmail($accountConn, $row['lock_to']);
|
||||
echo $row['lock_to'] . ',' . $email . ',' . $row['lock_count'] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
private function getAddressEmail($accountConn, $accountAddress)
|
||||
{
|
||||
$row = $accountConn->execQueryOne('select * from t_immutable_account where address=:address',
|
||||
array(
|
||||
'address' => $accountAddress
|
||||
));
|
||||
// error_log(json_encode($row));
|
||||
if (!empty($row)) {
|
||||
$dataJson = json_decode($row['data'], true);
|
||||
return $dataJson['decoded']['email'];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user