This commit is contained in:
aozhiwei 2021-12-08 12:14:55 +08:00
parent d0275cc9e8
commit e54f4767ef
2 changed files with 17 additions and 3 deletions

View File

@ -353,11 +353,13 @@ DROP TABLE IF EXISTS `t_drop_log`;
CREATE TABLE `t_drop_log` ( CREATE TABLE `t_drop_log` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
`drop_source` varchar(60) NOT NULL DEFAULT '' COMMENT '掉落源',
`drop_id` varchar(60) NOT NULL DEFAULT '' COMMENT '掉落id', `drop_id` varchar(60) NOT NULL DEFAULT '' COMMENT '掉落id',
`drop_items` mediumblob COMMENT '掉落的物品',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`),
KEY `account_id_drop_id` (`account_id`, `drop_id`) KEY `account_id_drop_source_drop_id` (`account_id`, `drop_source`, `drop_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -267,7 +267,7 @@ class BaseAuthedController extends BaseController {
} }
} }
public function _scatterDrop($dropMeta, $awardService, $propertyService) public function _scatterDrop($dropSource, $dropMeta, $awardService, $propertyService)
{ {
$itemIds = explode('|', $dropMeta['item_id']); $itemIds = explode('|', $dropMeta['item_id']);
$nums = explode('|', $dropMeta['num']); $nums = explode('|', $dropMeta['num']);
@ -312,8 +312,20 @@ class BaseAuthedController extends BaseController {
} }
} }
if (count($addItems) > 0) { if (count($addItems) > 0) {
$this->_addItems($addItems); $this->_addItems($addItems, $awardService, $propertyService);
} }
SqlHelper::insert(
myself()->_getSelfMysql(),
't_drop_log',
array(
'account_id' => myself()->_getAccountId(),
'drop_source' => $dropSource,
'drop_id' => $dropMeta['id'],
'drop_items' => json_encode($addItems),
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
)
);
} }
public function _getV($x, $y, $defVal = 0) public function _getV($x, $y, $defVal = 0)