game2004api/webapp/controller/ConfController.class.php
2025-02-19 15:07:07 +08:00

49 lines
1.2 KiB
PHP

<?php
require_once 'metatable/shopGoods.php';
require_once 'metatable/privilegecard.php';
require_once 'metatable/rechargeActivity.php';
require_once 'metatable/item.php';
class ConfController
{
public function get()
{
$account_id = $_REQUEST['account_id'];
//登录校验
$login = loginVerify($account_id, $_REQUEST['session_id']);
if (!$login) {
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
return;
}
$type = $_REQUEST['type'];
$conf = array();
switch ($type) {
case 1:
$conf = metatable\getRechargeActivityConf();
break;
case 2:
$conf = metatable\getPrivilegeCardConf();
break;
case 3:
$conf = metatable\getShopGoodsConf();
break;
case 4:
$conf = metatable\getItemConf();
break;
default:
phpcommon\sendError(ERR_USER_BASE + 1, '参数无效');
return;
}
echo json_encode(array(
'errcode' => 0,
'errmsg' => '',
'type' => $type,
'conf' => $conf,
));
}
}