1
This commit is contained in:
parent
2e7ce88882
commit
20fb209142
@ -37,31 +37,18 @@ class MarketController extends BaseController {
|
|||||||
$account = getReqVal('account', '');
|
$account = getReqVal('account', '');
|
||||||
$currBatchMeta = mt\MarketBatch::getCurrentBatch();
|
$currBatchMeta = mt\MarketBatch::getCurrentBatch();
|
||||||
if (!$currBatchMeta) {
|
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(
|
myself()->_rspData(array(
|
||||||
'presale_info' => $presaleInfo
|
'presale_info' => $this->getDefaultPresaleInfo()
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$countdown = mt\MarketBatch::getCountdown($currBatchMeta);
|
$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'];
|
$totalNum = $currBatchMeta['number_of_props'];
|
||||||
$buyed = MarketService::isTestMode() ? 0 : BoxOrder::isBuyed($account, $currBatchMeta['id']);
|
$buyed = MarketService::isTestMode() ?
|
||||||
|
0 : BoxOrder::isBuyed($account, $currBatchMeta['id']);
|
||||||
$title = '';
|
$title = '';
|
||||||
$state = self::PRESALE_PREPARE;
|
$state = self::PRESALE_PREPARE;
|
||||||
if ($countdown > 0) {
|
if ($countdown > 0) {
|
||||||
@ -465,4 +452,24 @@ class MarketController extends BaseController {
|
|||||||
MarketService::auth($account, $tips, $nonce, $signature);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user