Commit 43b0e64b authored by shajiaiming's avatar shajiaiming

调整dapp交易TSC信息接口

parent d1317895
......@@ -9,10 +9,10 @@
namespace api\controllers;
use api\base\BaseController;
use common\business\Chain33Business;
use common\models\psources\CoinDailyStatistics;
use common\models\psources\CoinDailyNumbers;
use common\models\psources\CoinDailyTimes;
use common\service\chain33\Chain33Service;
use Yii;
class VisitStatisticsController extends BaseController
......@@ -120,7 +120,7 @@ class VisitStatisticsController extends BaseController
return ['code' => -1,'data' => [], 'msg' => '缺少必要的参数'];
}
$service = new Chain33Service();
$service = new Chain33Business();
$result = $service->getDappTradeResult($coins_address);
if( 0 !== $result['code']){
......
......@@ -141,8 +141,27 @@ class Chain33Business
return $service->getBlockHashByHeight($height);
}
/**
* 获取coin地址下DAPP交易信息
* @param string $address
* @return array
*/
public static function getDappTradeResult($address)
{
$service = new Chain33Service();
$execer = 'wasm';
$funcName = 'WasmGetContractTable';
$contractName = 'user.p.tschain.user.wasm.dice';
$items[] = [
'tableName' => 'addrinfo',
'key' => 'addrinfo-' . $address
];
return $service->chain33Query($execer, $funcName, $contractName, $items);
}
/*
* 获取游戏状态
* @return array
*/
public static function getGameStatus()
{
......@@ -160,6 +179,9 @@ class Chain33Business
/*
* 获取投注状态
* @param integer $start
* @param integer $end
* @return array
*/
public static function getBetStatus($start, $end)
{
......
......@@ -97,6 +97,14 @@ class Chain33Service
return $this->send($params);
}
/**
* Chain33服务查询
* @param string $execer
* @param string $funcName
* @param string $contractName
* @param array $items
* @return array
*/
public function chain33Query($execer = 'wasm', $funcName = 'WasmGetContractTable', $contractName = 'user.p.para.user.wasm.dice', $items = [])
{
$params = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment