From e54f4767ef08a6728c851454c55ac14f2d954d6c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 8 Dec 2021 12:14:55 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 4 +++- webapp/controller/BaseAuthedController.class.php | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 9378423..ff8eecb 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -353,11 +353,13 @@ DROP TABLE IF EXISTS `t_drop_log`; CREATE TABLE `t_drop_log` ( `idx` bigint NOT NULL AUTO_INCREMENT 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_items` mediumblob COMMENT '掉落的物品', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', 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; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 988941b..03ead88 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -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']); $nums = explode('|', $dropMeta['num']); @@ -312,8 +312,20 @@ class BaseAuthedController extends BaseController { } } 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)