From ba3a85264ef8f731c15f9c7ae24b68cf8207b149 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 8 Feb 2022 11:36:44 +0800 Subject: [PATCH] 1 --- webapp/controller/MarketController.class.php | 15 +++++--- webapp/index.php | 40 ++++++++++---------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 94ffe4aa..39049802 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -102,12 +102,6 @@ class MarketController extends BaseController { $type = getReqVal('type', 0); $sort = getReqVal('sort', ''); - $currBatchMeta = mt\MarketBatch::getCurrentBatch(); - if (!$currBatchMeta) { - myself()->_rspErr(500, 'server internal error'); - return; - } - $perPage = 10000; $rows = array(); $pageInfo = array( @@ -118,6 +112,15 @@ class MarketController extends BaseController { 'total_pages' => 0 ); + $currBatchMeta = mt\MarketBatch::getCurrentBatch(); + if (!$currBatchMeta) { + myself()->_rspData(array( + 'rows' => $rows, + 'page' => $pageInfo, + )); + return; + } + $batchMetas = mt\MarketGoods::getBatchMetas($currBatchMeta['batch_id']); if ($batchMetas) { foreach ($batchMetas as $meta) { diff --git a/webapp/index.php b/webapp/index.php index 01f90108..b6263b95 100644 --- a/webapp/index.php +++ b/webapp/index.php @@ -1,6 +1,7 @@ _handlePre(); $obj->$a(); $obj->_handlePost();'); + $obj = eval('return new $classname();'); + $method = new ReflectionMethod($classname, $a); + if ($method && $method->isPublic() && + $a[0] != '_' && + (!$method->isConstructor() && !$method->isDestructor())) { + $obj->_handlePre(); + $method->invoke($obj); + $obj->_handlePost(); + } } catch (Exception $e){ - echo($e); + error_log($e); }