This commit is contained in:
aozhiwei 2022-04-02 19:37:33 +08:00
parent 2e7ce88882
commit 20fb209142

View File

@ -37,31 +37,18 @@ class MarketController extends BaseController {
$account = getReqVal('account', '');
$currBatchMeta = mt\MarketBatch::getCurrentBatch();
if (!$currBatchMeta) {
$title = $this->escapeString(
mt\Parameter::getVal('pre_sale_not_started_title', ''));
$hint = $this->escapeString(
mt\Parameter::getVal('pre_sale_not_started_hint', ''));
$presaleInfo = array(
'batch_id' => 0,
'countdown' => 0,
'sold_num' => 0,
'total_num' => 0,
'state' => self::PRESALE_NOT_STARTED,
'title' => $title,
'hint' => $hint,
'buyable_list' => array(),
//'buyed' => 0
);
myself()->_rspData(array(
'presale_info' => $presaleInfo
'presale_info' => $this->getDefaultPresaleInfo()
));
return;
}
$countdown = mt\MarketBatch::getCountdown($currBatchMeta);
$soldNum = min(BoxOrder::getSoldNum($currBatchMeta['id']), $currBatchMeta['number_of_props']);
$soldNum = min(BoxOrder::getSoldNum($currBatchMeta['id']),
$currBatchMeta['number_of_props']);
$totalNum = $currBatchMeta['number_of_props'];
$buyed = MarketService::isTestMode() ? 0 : BoxOrder::isBuyed($account, $currBatchMeta['id']);
$buyed = MarketService::isTestMode() ?
0 : BoxOrder::isBuyed($account, $currBatchMeta['id']);
$title = '';
$state = self::PRESALE_PREPARE;
if ($countdown > 0) {
@ -465,4 +452,24 @@ class MarketController extends BaseController {
MarketService::auth($account, $tips, $nonce, $signature);
}
private function getDefaultPresaleInfo()
{
$title = $this->escapeString(
mt\Parameter::getVal('pre_sale_not_started_title', ''));
$hint = $this->escapeString(
mt\Parameter::getVal('pre_sale_not_started_hint', ''));
$presaleInfo = array(
'batch_id' => 0,
'countdown' => 0,
'sold_num' => 0,
'total_num' => 0,
'state' => self::PRESALE_NOT_STARTED,
'title' => $title,
'hint' => $hint,
'buyable_list' => array(),
//'buyed' => 0
);
return $presaleInfo;
}
}