This commit is contained in:
aozhiwei 2022-01-25 20:08:13 +08:00
parent e8aa907a89
commit 6e4d821a30
2 changed files with 11 additions and 2 deletions

View File

@ -7,12 +7,16 @@ require_once('mt/WhiteList.php');
require_once('mt/Currency.php');
require_once('mt/Hero.php');
require_once('models/Box.php');
use phpcommon\SqlHelper;
use models\Box;
class NewMarketController extends BaseController {
public function searchBox()
{
$account = getReqVal('account', '');
$page = getReqVal('page', 1);
$type = getReqVal('type', 0);
$sort = getReqVal('sort', '');
@ -35,10 +39,10 @@ class NewMarketController extends BaseController {
$presaleInfo = array(
'batch_id' => $currBatchMeta['batch_id'],
'countdown' => max(0, $currBatchMeta['_start_time_utc'] - myself()->_getNowTime()),
'sold_num' => 0,
'sold_num' => min(Box::getSoldNum($currBatchMeta['batch_id']), $currBatchMeta['number_of_props']),
'inventory_num' => $currBatchMeta['number_of_props'],
'hint' => str_replace("\n", '\n', $currBatchMeta['hint']),
'buyed' => rand() % 2 < 1 ? 0 : 1
'buyed' => Box::isBuyed($account, $currBatchMeta['batch_id'])
);
$batchMetas = mt\MarketGoods::getBatchMetas($currBatchMeta['batch_id']);

View File

@ -9,7 +9,12 @@ class Box extends BaseModel {
public function getSoldNum($batchId)
{
return 0;
}
public function isBuyed($buyerAddress, $batchId)
{
return 0;
}
}