1
This commit is contained in:
parent
0d321a3d82
commit
ba3a85264e
@ -102,12 +102,6 @@ class MarketController extends BaseController {
|
|||||||
$type = getReqVal('type', 0);
|
$type = getReqVal('type', 0);
|
||||||
$sort = getReqVal('sort', '');
|
$sort = getReqVal('sort', '');
|
||||||
|
|
||||||
$currBatchMeta = mt\MarketBatch::getCurrentBatch();
|
|
||||||
if (!$currBatchMeta) {
|
|
||||||
myself()->_rspErr(500, 'server internal error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$perPage = 10000;
|
$perPage = 10000;
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$pageInfo = array(
|
$pageInfo = array(
|
||||||
@ -118,6 +112,15 @@ class MarketController extends BaseController {
|
|||||||
'total_pages' => 0
|
'total_pages' => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$currBatchMeta = mt\MarketBatch::getCurrentBatch();
|
||||||
|
if (!$currBatchMeta) {
|
||||||
|
myself()->_rspData(array(
|
||||||
|
'rows' => $rows,
|
||||||
|
'page' => $pageInfo,
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$batchMetas = mt\MarketGoods::getBatchMetas($currBatchMeta['batch_id']);
|
$batchMetas = mt\MarketGoods::getBatchMetas($currBatchMeta['batch_id']);
|
||||||
if ($batchMetas) {
|
if ($batchMetas) {
|
||||||
foreach ($batchMetas as $meta) {
|
foreach ($batchMetas as $meta) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require '../config/config.php';
|
require '../config/config.php';
|
||||||
|
require '../config/routes.php';
|
||||||
require 'bootstrap/init.php';
|
require 'bootstrap/init.php';
|
||||||
|
|
||||||
if (empty($_REQUEST['c']) || empty($_REQUEST['a'])) {
|
if (empty($_REQUEST['c']) || empty($_REQUEST['a'])) {
|
||||||
@ -8,12 +9,6 @@ if (empty($_REQUEST['c']) || empty($_REQUEST['a'])) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST['c'] != 'Market') {
|
|
||||||
die();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function autoload_controller__($classname)
|
function autoload_controller__($classname)
|
||||||
{
|
{
|
||||||
require_once "controller/$classname.class.php";
|
require_once "controller/$classname.class.php";
|
||||||
@ -21,25 +16,28 @@ function autoload_controller__($classname)
|
|||||||
}
|
}
|
||||||
spl_autoload_register('autoload_controller__');
|
spl_autoload_register('autoload_controller__');
|
||||||
|
|
||||||
$rewriteRule = array(
|
|
||||||
);
|
|
||||||
|
|
||||||
function getRewriteClass($oldC)
|
|
||||||
{
|
|
||||||
global $rewriteRule;
|
|
||||||
if (isset($rewriteRule[$oldC])) {
|
|
||||||
return $rewriteRule[$oldC];
|
|
||||||
}
|
|
||||||
return $oldC;
|
|
||||||
}
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$c = $_REQUEST['c'];
|
$c = $_REQUEST['c'];
|
||||||
$a = $_REQUEST['a'];
|
$a = $_REQUEST['a'];
|
||||||
$c = getRewriteClass($c);
|
if (!empty($gOnlyRoutes) && !getXVal($gOnlyRoutes, $c, null)) {
|
||||||
|
die();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!empty($gExcludeRoutes) && getXVal($gExcludeRoutes, $c, null)) {
|
||||||
|
die();
|
||||||
|
return;
|
||||||
|
}
|
||||||
$classname = $c .'Controller';
|
$classname = $c .'Controller';
|
||||||
$beginTick = phpcommon\getTickCount();
|
$beginTick = phpcommon\getTickCount();
|
||||||
$obj = eval('$obj = new $classname(); $obj->_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){
|
} catch (Exception $e){
|
||||||
echo($e);
|
error_log($e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user