diff --git a/webapp/controller/GunController.class.php b/webapp/controller/GunController.class.php index 797d040..77ed880 100644 --- a/webapp/controller/GunController.class.php +++ b/webapp/controller/GunController.class.php @@ -5,10 +5,12 @@ require_once('mt/GunTalent.php'); require_once('models/GunSkin.php'); require_once('models/GunTalent.php'); +require_once('models/User.php'); use phpcommon\SqlHelper; use models\GunSkin; use models\GunTalent; +use models\User; class GunController extends BaseAuthedController { @@ -69,13 +71,18 @@ class GunController extends BaseAuthedController { $this->_rspErr(2, '已满级'); return; } - $ormUserInfo = $this->_getOrmUserInfo(); + /*$ormUserInfo = $this->_getOrmUserInfo(); + if ($ormUserInfo['level'] < $growMeta['need_user_level']) { + $this->_rspErr(3, '用户等级未到达'); + return; + }*/ $costList = mt\GunTalentGrow::getCostList($growMeta); $lackItem = array(); if (!$this->_hasEnoughItems($costList, $lackItem)) { $this->_rspErr(3, '缺少材料'); return; } + $this->_decItems($costList); GunTalent::upgradeLv($typeId, $talentId, $currLv + 1); $this->_rspData(array( 'property_chg' => array( diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index c64eafe..d54ef6d 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -58,7 +58,7 @@ class UserController extends BaseAuthedController { 'account_id' => $this->_getAccountId(), 'name' => $userName, #'avatar_url' => $avatar_url, - 'gold' => 10000, + 'gold' => 10000 * 10000, #'season_status' => 1, #'newInfo' => '', #'new_second_equip' => 2, @@ -82,7 +82,7 @@ class UserController extends BaseAuthedController { } } { - $this->_addItem(array( + $this->_addItems(array( array( 'item_id' => 16001, 'item_num' => 0, diff --git a/webapp/mt/GunTalentGrow.php b/webapp/mt/GunTalentGrow.php index f9d6987..9cbaa64 100644 --- a/webapp/mt/GunTalentGrow.php +++ b/webapp/mt/GunTalentGrow.php @@ -31,7 +31,7 @@ class GunTalentGrow { public static function getByIdLv($talentId, $talentLv) { self::mustBeIdLvHash(); - $idMeta = getXVal($idLvHash, $talentId, null); + $idMeta = getXVal(self::$idLvHash, $talentId, null); return $idMeta ? getXVal($idMeta, $talentLv, null) : null; } @@ -40,12 +40,12 @@ class GunTalentGrow { if (!self::$idLvHash) { self::$idLvHash = array(); foreach (self::getMetaList() as $meta) { - $idMeta = getXVal($idLvHash, $talentId, null); + $idMeta = getXVal(self::$idLvHash, (int)$meta['talent_id'], null); if (!$idMeta) { $idMeta = array(); - $idLvHash[$meta['id']] = $idMeta; + self::$idLvHash[(int)$meta['talent_id']] = $idMeta; } - $idLvHash[$meta['id']][$meta['talent_lv']] = $meta; + self::$idLvHash[(int)$meta['talent_id']][(int)$meta['talent_lv']] = $meta; } } }