1
This commit is contained in:
parent
4632b3d3f3
commit
d52e97551c
21
webapp/controller/RechargeController.class.php
Normal file
21
webapp/controller/RechargeController.class.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
require_once('mt/Recharge.php');
|
||||
|
||||
class RechargeController extends BaseAuthedController {
|
||||
|
||||
public function goodsList()
|
||||
{
|
||||
$goods = array();
|
||||
mt\Recharge::traverseMeta(function ($meta) use(&$goods) {
|
||||
array_push($goods, array(
|
||||
'goods_id' => $meta['id'],
|
||||
'goods_meta' => $meta,
|
||||
));
|
||||
});
|
||||
myself()->_rspData(array(
|
||||
'goods' => $goods
|
||||
));
|
||||
}
|
||||
|
||||
}
|
26
webapp/mt/Recharge.php
Normal file
26
webapp/mt/Recharge.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace mt;
|
||||
|
||||
use phpcommon;
|
||||
|
||||
class Recharge {
|
||||
|
||||
public static function traverseMeta($cb)
|
||||
{
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
$cb($meta);
|
||||
}
|
||||
}
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('Recharge@Recharge.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
protected static $metaList;
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user