From 55a110bcbaaa0b851b7e083316efd9f199c7552c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 8 Jul 2024 20:05:25 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 18 ++++++++++++ webapp/controller/BattleController.class.php | 3 ++ webapp/models/TickConsumeRecord.php | 31 ++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 webapp/models/TickConsumeRecord.php diff --git a/sql/gamedb.sql b/sql/gamedb.sql index c1f8d8bc..cf830bc6 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1784,3 +1784,21 @@ CREATE TABLE `t_gold_bullion` ( KEY `idx_open_address_open_status` (`open_address`, `open_status`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_ticket_consume_record` +-- + +DROP TABLE IF EXISTS `t_ticket_consume_record`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_ticket_consume_record` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `match_room_uuid` varchar(60) NOT NULL DEFAULT '' COMMENT '匹配服房间id', + `account_id` varchar(60) COMMENT 'account_id', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `idx_match_room_uuid_account_id` (`match_room_uuid`, `account_id`), +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index d10f5544..17eaf2d3 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -10,6 +10,7 @@ require_once('models/User.php'); require_once('models/Parachute.php'); require_once('models/ChipPage.php'); require_once('models/Battle.php'); +require_once('models/TicketConsumeRecord.php'); require_once('services/BattleDataService.php'); require_once('services/TameBattleDataService.php'); require_once('services/RoomBattleDataService.php'); @@ -30,6 +31,7 @@ use models\User; use models\Parachute; use models\ChipPage; use models\Battle; +use models\TicketConsumeRecord; use phpcommon\TGLog; class BattleController extends BaseAuthedController { @@ -1172,6 +1174,7 @@ class BattleController extends BaseAuthedController { $itemDb = Bag::findEx($member['account_id'], $itemId); if (!empty($itemDb) || $itemDb['item_num'] > 0) { Bag::decItemByUnIidEx($member['account_id'], $itemDb['idx'], 1); + TicketConsumeRecord::add($roomUuid, $member['account_id']); } } } diff --git a/webapp/models/TickConsumeRecord.php b/webapp/models/TickConsumeRecord.php new file mode 100644 index 00000000..d60a2fcc --- /dev/null +++ b/webapp/models/TickConsumeRecord.php @@ -0,0 +1,31 @@ +_getMarketMysql(), + 't_ticket_consume_record', + array( + 'match_room_uuid' => $matchRoomUuid, + 'account_id' => $accountId, + ), + array( + + ), + array( + 'match_room_uuid' => $matchRoomUuid, + 'account_id' => $accountId, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + } + +}