This commit is contained in:
yangduo 2025-02-10 15:45:34 +08:00
parent 6ad456f8a7
commit fbfbf6bad6
2 changed files with 10 additions and 7 deletions

View File

@ -412,12 +412,12 @@ class AddReward {
} }
//添加道具 //添加道具
protected function addItem($item_id, $time, $accountid, $price, $t) protected function addItem($itemid, $hourtime, $accountid, $price, $t)
{ {
$item_list = array(); $item_list = array();
$item_num = 1; $item_num = 1;
$item_id = $item_id; $item_id = intval($itemid);
$time = $time; $time = intval($hourtime);
$conn = $this->getMysql($accountid); $conn = $this->getMysql($accountid);
if (!$conn) { if (!$conn) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
@ -586,7 +586,7 @@ class AddReward {
':accountid' => $accountid, ':accountid' => $accountid,
':id' => $id, ':id' => $id,
)); ));
if ($row['status'] != 0 || !$row) { if (!$row || $row['status'] != 0) {
continue; continue;
} }
$status = 2; $status = 2;

View File

@ -139,6 +139,9 @@ class BagController{
if ($b['fuction'] != 5 && $b['fuction'] != 6) { if ($b['fuction'] != 5 && $b['fuction'] != 6) {
foreach ($bag_meta_table as $bag_info) { foreach ($bag_meta_table as $bag_info) {
$id = $bag_info['id']; $id = $bag_info['id'];
if ($id == $item_id) {
continue;
}
$bag = $this->getBag($id); $bag = $this->getBag($id);
if ($bag['fuction'] != $b['fuction']) { if ($bag['fuction'] != $b['fuction']) {
continue; continue;
@ -148,7 +151,7 @@ class BagController{
':accountid' => $account_id, ':accountid' => $account_id,
':id' => $id, ':id' => $id,
)); ));
if ($row['status'] != 0 || !$row) { if (!$row || $row['status'] != 0) {
continue; continue;
} }
$status = 2; $status = 2;
@ -175,7 +178,7 @@ class BagController{
':accountid' => $account_id, ':accountid' => $account_id,
':id' => $item_id, ':id' => $item_id,
)); ));
if (!$row) { if (!$row || $row['status'] != 1 || $row['active_time'] < time()) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
return; return;
} }
@ -223,7 +226,7 @@ class BagController{
':accountid' => $account_id, ':accountid' => $account_id,
':id' => $item_id, ':id' => $item_id,
)); ));
if (!$row) { if (!$row || $row['status'] != 0) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
return; return;
} }