This commit is contained in:
aozhiwei 2021-12-02 16:09:24 +08:00
parent 61d4bd36ad
commit ebcef6e4da
3 changed files with 42 additions and 3 deletions

View File

@ -19,4 +19,18 @@ class Bag(object):
['!item_list', [_common.Item()], '物品列表']
]
},
{
'name': 'useItem',
'desc': '使用道具',
'group': 'Bag',
'url': 'webapp/index.php?c=Bag&a=useItem',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['award', _common.Award(), '奖励信息'],
['property_chg', _common.PropertyChg(), '属性变更'],
]
},
]

View File

@ -11,7 +11,7 @@ require_once('mt/SeasonPoint.php');
require_once('mt/RankReward.php');
require_once('mt/Equip.php');
require_once('mt/Hero.php');
require_once('mt/Robot.php');
require_once('mt/Rank.php');
require_once('services/PropertyChgService.php');
@ -48,6 +48,7 @@ class UserController extends BaseAuthedController {
private function createNewUser($userName, $avatarUrl)
{
$rankMeta = mt\Rank::get(1);
SqlHelper::upsert
($this->_getSelfMysql(),
't_user',
@ -66,8 +67,8 @@ class UserController extends BaseAuthedController {
'head_frame' => 19003,
'level' => 100,
'exp' => 0,
'rank' => 0,
'score' => 0,
'rank' => $rankMeta ? $rankMeta['id'] : 0,
'score' => $rankMeta ? $rankMeta['min_score'] : 0,
'head_id' => 18001,
'hero_id' => 30100,
'createtime' => $this->_getNowTime(),

24
webapp/mt/Rank.php Normal file
View File

@ -0,0 +1,24 @@
<?php
namespace mt;
use phpcommon;
class Rank {
public static function get($id)
{
return getXVal(self::getMetaList(), $id);
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('rank@rank.php');
}
return self::$metaList;
}
protected static $metaList;
}