This commit is contained in:
aozhiwei 2022-01-27 19:20:54 +08:00
parent 6f15c7d5bb
commit c758a4a4a4
2 changed files with 12 additions and 6 deletions

View File

@ -85,6 +85,11 @@ class MarketController extends BaseController {
foreach ($batchMetas as $meta) { foreach ($batchMetas as $meta) {
$heroMeta = mt\Hero::get($meta['item_id']); $heroMeta = mt\Hero::get($meta['item_id']);
$boxId = phpcommon\genBoxId($currBatchMeta['batch_id'], $meta['id'], $meta['item_id']); $boxId = phpcommon\genBoxId($currBatchMeta['batch_id'], $meta['id'], $meta['item_id']);
$currencyMeta = mt\Currency::get($meta['currency_id']);
if (!$currencyMeta) {
myself()->_rspErr(500, 'server internal error');
return;
}
$saleBox = array( $saleBox = array(
'box_id' => $boxId, 'box_id' => $boxId,
'item_id' => $meta['item_id'], 'item_id' => $meta['item_id'],
@ -92,11 +97,12 @@ class MarketController extends BaseController {
'job' => emptyReplace($heroMeta['herotype'], '1'), 'job' => emptyReplace($heroMeta['herotype'], '1'),
'currency_list' => array( 'currency_list' => array(
array( array(
'name' => 'BNB', 'name' => $currencyMeta['name'],
'original_price' => 100, 'original_price' => $meta['price'],
'discount_price' => 80, 'discount_price' => $meta['discount'] > 0 ?
'discount_rate' => 80, $meta['price'] * ($meta['discount'] / 100) : $meta['price'],
'contract_address' => '0xCfEB869F69431e42cdB54A4F4f105C19C080A601', 'discount_rate' => $meta['discount'],
'contract_address' => $currencyMeta['address'],
) )
) )
); );

View File

@ -17,7 +17,7 @@ class Currency {
protected static function getMetaList() protected static function getMetaList()
{ {
if (!self::$metaList) { if (!self::$metaList) {
self::$metaList = getMetaTable('currence@currence.php'); self::$metaList = getMetaTable('currency@currency.php');
} }
return self::$metaList; return self::$metaList;
} }