From f551f6db00daf652efbfebafc81cd82de87d7eed Mon Sep 17 00:00:00 2001 From: hujiabin Date: Thu, 27 Oct 2022 17:49:57 +0800 Subject: [PATCH] 1 --- webapp/controller/BagController.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 774325aa..9b525a74 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -268,13 +268,26 @@ class BagController extends BaseAuthedController { $this->_rspErr(1, "only supported rename card"); return; } + $costItems= array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => $itemMeta['gold'] + ) + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } $items = array( array( 'item_id' => $itemId, 'item_num' => 1 ) ); + $this->_decItems($costItems); $this->_addItems($items, $this->awardService, $this->propertyChgService); + $this->propertyChgService->addUserChg(); $this->propertyChgService->addBagChg(); $this->_rspData(array( 'award' => $this->awardService->toDto(),