diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 8afb85aa..cabb366f 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -58,7 +58,7 @@ class MarketController extends BaseController { return; } - $countdown = max(0, $currBatchMeta['start_time'] - myself()->_getNowTime()); + $countdown = mt\MarketBatch::getCountdown($currBatchMeta); $soldNum = min(BoxOrder::getSoldNum($currBatchMeta['id']), $currBatchMeta['number_of_props']); $totalNum = $currBatchMeta['number_of_props']; $buyed = MarketService::isTestMode() ? 0 : BoxOrder::isBuyed($account, $currBatchMeta['id']); @@ -87,7 +87,7 @@ class MarketController extends BaseController { //'buyed' => $buyed ); - if ($this->isTestMode()) { + if (MarketService::isTestMode()) { foreach(array_keys($presaleInfo) as $key) { if (!is_null(getReqVal($key, null))) { $presaleInfo[$key] = getReqVal($key, $presaleInfo[$key]); diff --git a/webapp/mt/MarketBatch.php b/webapp/mt/MarketBatch.php index 1f53cb16..f02cd104 100644 --- a/webapp/mt/MarketBatch.php +++ b/webapp/mt/MarketBatch.php @@ -34,6 +34,12 @@ class MarketBatch { return $currentMeta; } + public static function getCountdown($meta) + { + $countdown = max(0, $currBatchMeta['start_time'] - myself()->_getNowTime()); + return $countdown; + } + protected static function getMetaList() { if (!self::$metaList) {