This commit is contained in:
hujiabin 2024-08-02 16:08:21 +08:00
parent 9441d0705c
commit b4d42892cb
3 changed files with 12 additions and 7 deletions

View File

@ -45,10 +45,10 @@ class HeroSkin(object):
['data', _common.HeroSkin(), '皮肤详情']
]
},{
'name': 'takeonSkin',
'name': 'takeonSkinS',
'desc': '皮肤穿戴',
'group': 'HeroSkin',
'url': 'webapp/index.php?c=HeroSkin&a=takeonSkin',
'surl': 'webapp/index.php?c=HeroSkin&a=takeonSkinS',
'params': [
_common.ReqHead(),
['hero_uniid', 0, '英雄uniid'],
@ -58,10 +58,10 @@ class HeroSkin(object):
_common.RspHead(),
]
},{
'name': 'demountSkin',
'name': 'demountSkinS',
'desc': '皮肤卸下',
'group': 'HeroSkin',
'url': 'webapp/index.php?c=HeroSkin&a=demountSkin',
'surl': 'webapp/index.php?c=HeroSkin&a=demountSkinS',
'params': [
_common.ReqHead(),
['hero_uniid', 0, '英雄uniid'],

View File

@ -27,6 +27,8 @@
* c=Hero&a=synHeroS
* c=Hero&a=upgradeQualityS
* c=HeroSkin&a=synSkinS
* c=HeroSkin&a=takeonSkinS
* c=HeroSkin&a=demountSkinS
* c=InGameMall&a=sellS
* c=InGameMall&a=buyS
* c=InGameMall&a=cancelS

View File

@ -62,7 +62,7 @@ class HeroSkinController extends BaseAuthedController {
));
}
public function takeonSkin()
public function takeonSkinS()
{
$heroUniid = getReqVal('hero_uniid', 0);
$skinUniid = getReqVal('skin_uniid', 0);
@ -83,6 +83,7 @@ class HeroSkinController extends BaseAuthedController {
if ($heroSkinDb['hero_uniid']){
$removeNum += 1;
}
$propertyChgService = new services\PropertyChgService();
if ($removeNum > 0){
$goldNum = \mt\Parameter::getVal('hero_dress_remove_price',200);
$costItems = array(
@ -96,6 +97,7 @@ class HeroSkinController extends BaseAuthedController {
return;
}
$this->_decItems($costItems);
$propertyChgService->addUserChg();
}
if ($heroDb['skin_id']){
HeroSkin::update($heroDb['skin_id'],array(
@ -120,14 +122,14 @@ class HeroSkinController extends BaseAuthedController {
'hero_uniid'=>$heroUniid,
'modifytime'=>myself()->_getNowTime(),
));
$propertyChgService = new services\PropertyChgService();
$propertyChgService->addHeroChg();
$this->_rspData(array(
'property_chg' => $propertyChgService->toDto(),
));
}
public function demountSkin(){
public function demountSkinS(){
$heroUniid = getReqVal('hero_uniid', 0);
$heroDb = Hero::find($heroUniid);
if (!$heroDb) {
@ -161,6 +163,7 @@ class HeroSkinController extends BaseAuthedController {
));
$propertyChgService = new services\PropertyChgService();
$propertyChgService->addHeroChg();
$propertyChgService->addUserChg();
$this->_rspData(array(
'property_chg' => $propertyChgService->toDto(),
));