完成getEquipUp改造
This commit is contained in:
parent
9a7a8bf401
commit
9569816478
@ -6,20 +6,10 @@ require 'NTaskController.class.php';
|
||||
|
||||
require_once('mt/Parameter.php');
|
||||
require_once('mt/Drop.php');
|
||||
require_once('mt/EquipUpgrade.php');
|
||||
|
||||
class RoleController extends BaseAuthedController {
|
||||
|
||||
protected function getEquipUp($equipUp_id)
|
||||
{
|
||||
$g_conf_equipUp_cluster = require('../res/equipUpgrade@equipUpgrade.php');
|
||||
$equipUp_conf = getEquipUpgradeConfig($g_conf_equipUp_cluster, $equipUp_id);
|
||||
$e = array(
|
||||
'id' => $equipUp_conf['id'],
|
||||
'coin_num' => $equipUp_conf['coin_num'],
|
||||
);
|
||||
return $e;
|
||||
}
|
||||
|
||||
protected function getExplode($string)
|
||||
{
|
||||
$delim = "|";
|
||||
@ -1419,7 +1409,7 @@ class RoleController extends BaseAuthedController {
|
||||
$p3 = mt\Parameter::getOldParam(DAILYCOIN_NUM);
|
||||
$num = $p3['param_value'];
|
||||
|
||||
$e = $this->getEquipUp($rowEquip['id']);
|
||||
$e = mt\EquipUpgrade::getOldEquipUp($rowEquip['id']);
|
||||
$eg = $this->getEquip($rowEquip['id']);
|
||||
if (!$e || !$eg) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个装备');
|
||||
|
33
webapp/mt/EquipUpgrade.php
Normal file
33
webapp/mt/EquipUpgrade.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace mt;
|
||||
|
||||
use phpcommon;
|
||||
|
||||
class Parameter {
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
|
||||
}
|
||||
|
||||
public static function getOldEquipUp($id)
|
||||
{
|
||||
$meta = self::get($id);
|
||||
return array(
|
||||
'id' => $meta['id'],
|
||||
'coin_num' => $meta['coin_num'],
|
||||
);
|
||||
}
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('equipUpgrade@equipUpgrade.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
protected static $metaList;
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user