From 1ebc1c831737735b04af6458c877b9597ebb3b76 Mon Sep 17 00:00:00 2001 From: yangduo Date: Thu, 13 Feb 2025 15:56:08 +0800 Subject: [PATCH] fix --- webapp/controller/BagController.class.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 7858703..92cc501 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -150,14 +150,10 @@ class BagController //正在装备的道具 if ($b['fuction'] != 5 && $b['fuction'] != 6) { foreach ($bag_meta_table as $bag_info) { + if ($bag_info['fuction'] != $b['fuction']) { + continue; + } $id = $bag_info['id']; - if ($id == $item_id) { - continue; - } - $bag = $this->getBag($id); - if ($bag['fuction'] != $b['fuction']) { - continue; - } $row = $conn->execQueryOne( 'SELECT status, active_time, color_id FROM bag WHERE accountid=:accountid AND id=:id;', array( @@ -172,10 +168,8 @@ class BagController if ($row['active_time'] == 0 || $row['active_time'] > time()) { $status = 1; } - $altercolor = false; $colorid = 0; if ($id == $item_id) { - $altercolor = true; //仅改变颜色 if ($color_id == $row['color_id']) { echo json_encode($rsp); @@ -199,7 +193,7 @@ class BagController die(); return; } - if ($altercolor) { + if ($id == $item_id) { echo json_encode($rsp); return; } @@ -207,7 +201,7 @@ class BagController } //要装备的道具 $row = $conn->execQueryOne( - 'SELECT status FROM bag WHERE accountid=:accountid AND id=:id;', + 'SELECT status, active_time FROM bag WHERE accountid=:accountid AND id=:id;', array( ':accountid' => $account_id, ':id' => $item_id,