1
This commit is contained in:
parent
8d28eb373d
commit
83fb847196
@ -70,11 +70,12 @@ class MarketController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$out = array(
|
$out = array(
|
||||||
|
'rows' => array(),
|
||||||
'pagination' => array()
|
'pagination' => array()
|
||||||
);
|
);
|
||||||
SqlHelper::rawQueryPage(
|
SqlHelper::rawQueryPage(
|
||||||
myself()->_getMySql(''),
|
myself()->_getMySql(''),
|
||||||
'SELECT * FROM t_market WHERE activated=:activated',
|
'SELECT * FROM t_market WHERE activated=:activated AND status = 0',
|
||||||
array(
|
array(
|
||||||
':activated' => 1
|
':activated' => 1
|
||||||
),
|
),
|
||||||
@ -180,12 +181,13 @@ class MarketController extends BaseAuthedController {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
//'orderBy' => $orderBy,
|
//'orderBy' => $orderBy,
|
||||||
'handle' => function ($row) {
|
'handle' => function ($row) use (&$out) {
|
||||||
array_push($out['rows'], $this->fillNftIntro($row));
|
array_push($out['rows'], $this->fillNftIntro($row));
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
$out['pagination']
|
$out['pagination']
|
||||||
);
|
);
|
||||||
|
error_log(json_encode($out));
|
||||||
myself()->_rspData($out);
|
myself()->_rspData($out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,10 +202,21 @@ class MarketController extends BaseAuthedController {
|
|||||||
'price' => $row['update_price'] ? $row['update_price'] : $row['price'],
|
'price' => $row['update_price'] ? $row['update_price'] : $row['price'],
|
||||||
'selltime' => $row['selltime'],
|
'selltime' => $row['selltime'],
|
||||||
'updatetime' => $row['createtime'],
|
'updatetime' => $row['createtime'],
|
||||||
|
'details' => array()
|
||||||
);
|
);
|
||||||
$nftDb = Nft::getNftByNetCont($row['token_id'], $row['net_id'], $row['nft_token']);
|
$nftDb = Nft::getNftByNetCont($row['token_id'], $row['net_id'], $row['nft_token']);
|
||||||
if ($nftDb) {
|
if ($nftDb) {
|
||||||
$nftDb['detail'] = Nft::toDto($nftDb);
|
switch ($nftDb['token_type']) {
|
||||||
|
case Nft::HERO_TYPE:
|
||||||
|
{
|
||||||
|
error_log(json_encode($nftDb));
|
||||||
|
$heroDb = Hero::findByTokenId2($nftDb['token_id']);
|
||||||
|
if ($heroDb){
|
||||||
|
$info['details'] = Hero::toDto($heroDb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
require_once('phpcommon/bignumber.php');
|
require_once('phpcommon/bignumber.php');
|
||||||
require_once('phpcommon/sqlhelper.php');
|
require_once('phpcommon/sqlhelper.php');
|
||||||
|
require_once('services/BlockChainService.php');
|
||||||
|
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
|
use services\BlockChainService;
|
||||||
|
|
||||||
class ToolsController extends BaseController {
|
class ToolsController extends BaseController {
|
||||||
|
|
||||||
@ -142,6 +144,9 @@ class ToolsController extends BaseController {
|
|||||||
|
|
||||||
public function outappRecharge()
|
public function outappRecharge()
|
||||||
{
|
{
|
||||||
|
$price = BlockChainService::formatCurrencyEx(1, 6);
|
||||||
|
echo $price;
|
||||||
|
return;
|
||||||
/*{
|
/*{
|
||||||
$obj = array(
|
$obj = array(
|
||||||
'a' => 'safdf'
|
'a' => 'safdf'
|
||||||
|
@ -23,7 +23,7 @@ class Market extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function add($orderId, $netId, $tokenId, $seller, $nftToken,
|
public static function add($orderId, $netId, $tokenId, $seller, $nftToken,
|
||||||
$amount, $currency, $pirce, $fieldsKv) {
|
$amount, $currency, $price, $fieldsKv) {
|
||||||
if (empty($fieldsKv)) {
|
if (empty($fieldsKv)) {
|
||||||
$fieldsKv = array();
|
$fieldsKv = array();
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace models;
|
namespace models;
|
||||||
|
|
||||||
require_once('mt/Attr.php');
|
require_once('mt/Attr.php');
|
||||||
|
require_once('mt/Hero.php');
|
||||||
require_once('mt/Item.php');
|
require_once('mt/Item.php');
|
||||||
require_once('mt/Equip.php');
|
require_once('mt/Equip.php');
|
||||||
require_once('mt/GunLevel.php');
|
require_once('mt/GunLevel.php');
|
||||||
|
@ -30,16 +30,16 @@ class MarketSellOrderOk {
|
|||||||
$price = getReqVal('price', '');
|
$price = getReqVal('price', '');
|
||||||
|
|
||||||
$fieldsKv = array();
|
$fieldsKv = array();
|
||||||
$nftDb = Nft::getNftByNetCont($row['token_id'], $netId, $nftToken);
|
$nftDb = Nft::getNftByNetCont($tokenId, $netId, $nftToken);
|
||||||
if ($nftDb) {
|
if ($nftDb) {
|
||||||
try {
|
try {
|
||||||
$nftDetail = Nft::toDto($nftDb);
|
$nftDetail = Nft::toDto($nftDb);
|
||||||
if ($nftDetail) {
|
if ($nftDetail) {
|
||||||
$fieldsKv['c_name'] = $nftDetail['info']['name'];
|
$fieldsKv['c_name'] = $nftDetail['info']['name'];
|
||||||
$fieldsKv['c_job'] = $nftDetail['info']['job'];
|
$fieldsKv['c_job'] = $nftDetail['info']['job'];
|
||||||
$fieldsKv['c_lv'] = $nftDetail['info']['hero_lv'];
|
$fieldsKv['c_lv'] = $nftDetail['info']['level'];
|
||||||
$fieldsKv['c_quality'] = $nftDetail['info']['quality'];
|
$fieldsKv['c_quality'] = $nftDetail['info']['quality'];
|
||||||
$fieldsKv['c_durability'] = $nftDetail['info']['hero_tili'];
|
//$fieldsKv['c_durability'] = $nftDetail['info']['hero_tili'];
|
||||||
$fieldsKv['c_type'] = 1;
|
$fieldsKv['c_type'] = 1;
|
||||||
}
|
}
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user