This commit is contained in:
hujiabin 2022-09-19 22:01:30 +08:00
parent a39eaf6e0a
commit aa6c1e98bf
3 changed files with 24 additions and 1 deletions

View File

@ -15,7 +15,7 @@ class Team(object):
_common.ReqHead(),
['node_id', 0, '节点id'],
['map_id', 0, '地图id'],
['match_mode', 0, '0: 匹配赛模式 1: 排位赛 3: pve'],
['match_mode', 0, '0: 匹配赛模式 1: 排位赛 2: pve'],
['pve_instance_id', 0, 'pve副本id'],
],
'response': [

View File

@ -701,6 +701,7 @@ class Chip(object):
['strength', '', '前一天体力值'],
['strength_temporary', '', '升级成功所得出的总体力值'],
['mint', '', '所需mint费'],
['belong_to_item_id', '', '所镶嵌的英雄或枪械的item id'],
]

View File

@ -94,9 +94,31 @@ class Chip extends BaseModel
$row['rand_attr'] = $attrs;
$row['today_get_gold'] = $todayGetGold;
$row['last_get_gold_time'] = $lastGetGoldTime;
$row['belong_to_item_id'] = self::belongsToWhere($row);
return $row;
}
public static function belongsToWhere($row){
if ($row['chip_type'] == 1){
$heroDb = array();
Hero::getHeroList(function ($hero) use ($row,&$heroDb) {
if ($hero['chip_ids'] && strstr($hero['chip_ids']."|",strval($row['idx']."|")) ){
$heroDb = $hero;
}
});
return $heroDb['hero_id'];
}
if ($row['chip_type'] == 2){
$gunDb = array();
Gun::getGunList(function ($gun) use($row,&$gunDb) {
if ($gun['chip_ids'] && strstr($gun['chip_ids']."|",strval($row['idx']."|")) ){
$gunDb = $gun;
}
});
return $gunDb['gun_id'];
}
}
public static function addChip($itemId, $tokenId)
{
return self::internalAddItem(