game2006api/webapp/metatable/shopGoods.php
2020-12-22 14:35:26 +08:00

39 lines
774 B
PHP

<?php
namespace metatable;
use phpcommon;
/*
配置表规范
getXXXConf:获取表所有数据
getXxxById():通过id获取单个数据
_internalGetXXXConf:获取表所有数据内部实现不对外开放
使用方式
require_once 'metatable/XXXX.php';
!!!注意必须使用require_once
*/
function getShopGoodsConf()
{
return _internalGetShopGoodsConf();
}
function getShopGoodsById($shop_id)
{
$conf = getShopGoodsConf();
$shop_id = (int)$shop_id;
return array_key_exists($shop_id, $conf) ? $conf[$shop_id] : null;
}
function _internalGetShopGoodsConf()
{
global $g_shopGoods_table;
if (!$g_shopGoods_table) {
$g_shopG_table = require(getConfigBaseDir() . 'shopGoods@shopGoods.php');
}
return $g_shopG_table;
}