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

View File

@ -27,6 +27,8 @@
* c=Hero&a=synHeroS * c=Hero&a=synHeroS
* c=Hero&a=upgradeQualityS * c=Hero&a=upgradeQualityS
* c=HeroSkin&a=synSkinS * c=HeroSkin&a=synSkinS
* c=HeroSkin&a=takeonSkinS
* c=HeroSkin&a=demountSkinS
* c=InGameMall&a=sellS * c=InGameMall&a=sellS
* c=InGameMall&a=buyS * c=InGameMall&a=buyS
* c=InGameMall&a=cancelS * 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); $heroUniid = getReqVal('hero_uniid', 0);
$skinUniid = getReqVal('skin_uniid', 0); $skinUniid = getReqVal('skin_uniid', 0);
@ -83,6 +83,7 @@ class HeroSkinController extends BaseAuthedController {
if ($heroSkinDb['hero_uniid']){ if ($heroSkinDb['hero_uniid']){
$removeNum += 1; $removeNum += 1;
} }
$propertyChgService = new services\PropertyChgService();
if ($removeNum > 0){ if ($removeNum > 0){
$goldNum = \mt\Parameter::getVal('hero_dress_remove_price',200); $goldNum = \mt\Parameter::getVal('hero_dress_remove_price',200);
$costItems = array( $costItems = array(
@ -96,6 +97,7 @@ class HeroSkinController extends BaseAuthedController {
return; return;
} }
$this->_decItems($costItems); $this->_decItems($costItems);
$propertyChgService->addUserChg();
} }
if ($heroDb['skin_id']){ if ($heroDb['skin_id']){
HeroSkin::update($heroDb['skin_id'],array( HeroSkin::update($heroDb['skin_id'],array(
@ -120,14 +122,14 @@ class HeroSkinController extends BaseAuthedController {
'hero_uniid'=>$heroUniid, 'hero_uniid'=>$heroUniid,
'modifytime'=>myself()->_getNowTime(), 'modifytime'=>myself()->_getNowTime(),
)); ));
$propertyChgService = new services\PropertyChgService();
$propertyChgService->addHeroChg(); $propertyChgService->addHeroChg();
$this->_rspData(array( $this->_rspData(array(
'property_chg' => $propertyChgService->toDto(), 'property_chg' => $propertyChgService->toDto(),
)); ));
} }
public function demountSkin(){ public function demountSkinS(){
$heroUniid = getReqVal('hero_uniid', 0); $heroUniid = getReqVal('hero_uniid', 0);
$heroDb = Hero::find($heroUniid); $heroDb = Hero::find($heroUniid);
if (!$heroDb) { if (!$heroDb) {
@ -161,6 +163,7 @@ class HeroSkinController extends BaseAuthedController {
)); ));
$propertyChgService = new services\PropertyChgService(); $propertyChgService = new services\PropertyChgService();
$propertyChgService->addHeroChg(); $propertyChgService->addHeroChg();
$propertyChgService->addUserChg();
$this->_rspData(array( $this->_rspData(array(
'property_chg' => $propertyChgService->toDto(), 'property_chg' => $propertyChgService->toDto(),
)); ));