1
This commit is contained in:
parent
9bd28deb0c
commit
6b0360c618
@ -56,14 +56,26 @@ class MarketController extends BaseController {
|
|||||||
|
|
||||||
$countdown = max(0, $currBatchMeta['start_time'] - myself()->_getNowTime());
|
$countdown = max(0, $currBatchMeta['start_time'] - myself()->_getNowTime());
|
||||||
$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 = $this->isTestMode() ? 0 : BoxOrder::isBuyed($account, $currBatchMeta['id']);
|
$buyed = $this->isTestMode() ? 0 : BoxOrder::isBuyed($account, $currBatchMeta['id']);
|
||||||
$title = '';
|
$title = '';
|
||||||
$state = 0;
|
$state = PRESALE_PREPARE;
|
||||||
|
if ($countdown > 0) {
|
||||||
|
$state = PRESALE_PREPARE;
|
||||||
|
} else {
|
||||||
|
if ($soldNum >= $totalNum) {
|
||||||
|
$title = $this->escapeString($currBatchMeta['end_title']);
|
||||||
|
$state = PRESALE_SOLD_OUT;
|
||||||
|
} else {
|
||||||
|
$title = $this->escapeString($currBatchMeta['begin_title']);
|
||||||
|
$state = PRESALE_STARTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
$presaleInfo = array(
|
$presaleInfo = array(
|
||||||
'batch_id' => $currBatchMeta['batch_id'],
|
'batch_id' => $currBatchMeta['batch_id'],
|
||||||
'countdown' => $countdown,
|
'countdown' => $countdown,
|
||||||
'sold_num' => $soldNum,
|
'sold_num' => $soldNum,
|
||||||
'total_num' => $currBatchMeta['number_of_props'],
|
'total_num' => $totalNum,
|
||||||
'state' => $state,
|
'state' => $state,
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'hint' => $this->escapeString($currBatchMeta['hint']),
|
'hint' => $this->escapeString($currBatchMeta['hint']),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user