This commit is contained in:
aozhiwei 2024-07-08 20:05:25 +08:00
parent 71053de65f
commit 55a110bcba
3 changed files with 52 additions and 0 deletions

View File

@ -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 */;

View File

@ -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']);
}
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class TicketConsumeRecord extends BaseModel {
public static function add($matchRoomUuid, $accountId)
{
SqlHelper::upsert(
myself()->_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(),
)
);
}
}