From 109f7478d6866c70d6bdf2f132849c715cc032ab Mon Sep 17 00:00:00 2001 From: yangduo Date: Wed, 15 Jan 2025 15:35:05 +0800 Subject: [PATCH] adjust --- webapp/classes/AddReward.php | 14 ++++++++++++++ webapp/controller/RechargeController.class.php | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/webapp/classes/AddReward.php b/webapp/classes/AddReward.php index 50888fd..ea26f20 100644 --- a/webapp/classes/AddReward.php +++ b/webapp/classes/AddReward.php @@ -192,6 +192,20 @@ class AddReward { return $row['diamond_num']; } + public function getAdfree($accountid) + { + $conn = $this->getMysql($accountid); + if (!$conn) { + phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); + die(); + } + $row = $conn->execQueryOne('SELECT adfree FROM recharge WHERE accountid=:accountid;', + array( + ':accountid' => $accountid + )); + return $row ? $row['adfree'] : 0; + } + //添加钻石 protected function addDiamond($item_id, $item_num, $accountid) { diff --git a/webapp/controller/RechargeController.class.php b/webapp/controller/RechargeController.class.php index 06efc64..9cf831b 100644 --- a/webapp/controller/RechargeController.class.php +++ b/webapp/controller/RechargeController.class.php @@ -1073,11 +1073,14 @@ class RechargeController $coin_num = $addreward->getCoinNum($account_id); $diamond_num = $addreward->getDiamondNum($account_id); + $adfree = $addreward->getAdfree($account_id); echo json_encode(array( 'errcode' => 0, 'errmsg' => '', 'coin_nums' => $coin_num, 'diamond_nums' => $diamond_num, + 'adfree' => $adfree, + 'id' => $_REQUEST['id'], 'item_list' => $item_list, 'vip_info' => json_encode($vipinfo), 'all_item_list' => $all_item_list, @@ -1200,11 +1203,14 @@ class RechargeController $coin_num = $addreward->getCoinNum($account_id); $diamond_num = $addreward->getDiamondNum($account_id); + $adfree = $addreward->getAdfree($account_id); echo json_encode(array( 'errcode' => 0, 'errmsg' => '', 'coin_nums' => $coin_num, 'diamond_nums' => $diamond_num, + 'adfree' => $adfree, + 'id' => $_REQUEST['id'], 'item_list' => $item_list, 'recharge_activity' => json_encode($activity), 'all_item_list' => $all_item_list,