This commit is contained in:
hujiabin 2023-04-06 17:31:09 +08:00
parent 2c7a64bfea
commit 2d645b19c1
3 changed files with 53 additions and 16 deletions

View File

@ -699,6 +699,25 @@ CREATE TABLE `t_battle_settlement_team` (
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `t_battle_settlement_team`
--
DROP TABLE IF EXISTS `t_battle_input`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_battle_input` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`battle_uuid` varchar(60) NOT NULL DEFAULT '' COMMENT '战斗记录唯一id',
`room_uuid` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'room_id',
`input` mediumblob COMMENT 'input',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `battle_room_uuid` (`battle_uuid`, `room_uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `t_battle_history`
--

View File

@ -129,6 +129,24 @@ class BattleController extends BaseAuthedController {
$this->_rspErr(1, 'Repeated request');
return;
}
SqlHelper::upsert
(myself()->_getSelfMysql(),
't_battle_input',
array(
'battle_uuid' => $battle_uuid,
'room_uuid' => $room_uuid,
),
array(
'input' => json_encode($data)
),
array(
'battle_uuid' => $battle_uuid,
'room_uuid' => $room_uuid,
'input' => json_encode($data),
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(),
)
);
$teamList = array();
if ($data) {
$teamList = $data['team_list'];

View File

@ -130,17 +130,17 @@ class UserController extends BaseAuthedController {
}
private function _addFreeItem(){
$chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE);
foreach ($chipMeta as $row){
Chip::addChip($row);
}
foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
$heroMeta = mt\Item::get($heroId);
if ($heroMeta) {
Hero::addHero($heroMeta);
}
}
// $chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE);
// foreach ($chipMeta as $row){
// Chip::addChip($row);
// }
//
// foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
// $heroMeta = mt\Item::get($heroId);
// if ($heroMeta) {
// Hero::addHero($heroMeta);
// }
// }
$addItems =array();
foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) {
list($itemId, $itemNum) = explode(':', $itemsStr);
@ -152,11 +152,11 @@ class UserController extends BaseAuthedController {
));
}
}
array_push($addItems,
array(
'item_id' => V_ITEM_GOLD,
'item_num' => 50
));
// array_push($addItems,
// array(
// 'item_id' => V_ITEM_GOLD,
// 'item_num' => 50
// ));
$awardService = new services\AwardService();
$propertyChgService = new services\PropertyChgService();