From 7ba0216b5784b7ef464d7b41d56e7c189ba37416 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 14:25:45 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 9603a20d..3c0cde25 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -479,6 +479,22 @@ class UserController extends BaseAuthedController { )); } + public function getBattleItem() + { + $itemId = getReqVal("item_id", ""); + $itemMeta = mt\Item::get($itemId); + if (empty($itemMeta)) { + myself()->_rspErr(1, 'item_id not found'); + return; + } + $itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId); + myself()->_rspData(array( + 'item_id' => $itemId, + 'item_type' => $itemMeta['type'], + 'item_sub_type' => $itemMeta['sub_type'] + )); + } + public function query() { $name = getReqVal('name', '');