From fd634e80ce8e1a63d87239111e1060b6509ee69a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 2 Aug 2023 21:26:03 +0800 Subject: [PATCH] 1 --- doc/DailySelection.py | 8 ++--- doc/_common.py | 1 - sql/gamedb.sql | 31 +++++++++++++++++++ .../DailySelectionController.class.php | 21 ------------- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/doc/DailySelection.py b/doc/DailySelection.py index ea5104b6..d6aad094 100644 --- a/doc/DailySelection.py +++ b/doc/DailySelection.py @@ -16,7 +16,6 @@ class DailySelection(object): ], 'response': [ _common.RspHead(), - ['idx', 0, '每日精选的索引'], ['refresh_info', '', '每日精选的刷新信息(格式:刷新次数/可刷新总数)'], ['cost', 0, '每日精选的当前刷新价格,-1表示不可刷新'], ['!goods_list', [_common.DailySelectionGoods()], '每日精选列表'], @@ -36,20 +35,17 @@ class DailySelection(object): ] }, { - 'name': 'buyGoodsDS', + 'name': 'buy', 'desc': '购买每日精选商品', 'group': 'DailySelection', - 'url': 'webapp/index.php?c=DailySelection&a=buyGoodsDS', + 'url': 'webapp/index.php?c=DailySelection&a=buy', 'params': [ _common.ReqHead(), - ['idx', 0, '每日精选的索引'], ['grid', 0, '商品在每日精选中的位置索引'], - ['count', 0, '购买数量,始终是1'], ['token_type', '', "选用币种,只能选择一种"], ], 'response': [ _common.RspHead(), - ['block_chain', _common.ShopTrans(), '链上购买订单信息'] ] } ] diff --git a/doc/_common.py b/doc/_common.py index ff28e981..8dbcf424 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -471,7 +471,6 @@ class DailySelectionGoods(object): ['token_type', '', '代币类型(4|0)'], ['discount', '', '折扣(95|80)'], ['price', '', '价格(100|100000)'], - ['pending', 0, '购买中...'], ] class Mission(object): diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 42fa5783..06e7f571 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1376,6 +1376,37 @@ CREATE TABLE `t_outapp_order` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `t_dailyselection` +-- + +DROP TABLE IF EXISTS `t_dailyselection`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_dailyselection` ( + `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL COMMENT 'account_id', + `refresh_mode` int(11) NOT NULL COMMENT '0-每日自动刷新时间 1-手动刷新时间', + `refresh_time` int(11) NOT NULL DEFAULT '0' COMMENT '刷新时间', + `grid_1` int(11) NOT NULL, + `grid_2` int(11) NOT NULL, + `grid_3` int(11) NOT NULL, + `grid_4` int(11) NOT NULL, + `grid_5` int(11) NOT NULL, + `grid_6` int(11) NOT NULL, + `count_1` tinyint(4) NOT NULL, + `count_2` tinyint(4) NOT NULL, + `count_3` tinyint(4) NOT NULL, + `count_4` tinyint(4) NOT NULL, + `count_5` tinyint(4) NOT NULL, + `count_6` tinyint(4) NOT NULL, + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `account_id` (`account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + DROP TABLE IF EXISTS `t_web2_order`; CREATE TABLE `t_web2_order` ( `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id', diff --git a/webapp/controller/DailySelectionController.class.php b/webapp/controller/DailySelectionController.class.php index a6efc6bd..eee11bdd 100644 --- a/webapp/controller/DailySelectionController.class.php +++ b/webapp/controller/DailySelectionController.class.php @@ -54,9 +54,6 @@ class DailySelectionController extends BaseAuthedController { { $address = $this->_getAccountId(); - // 不清除过期的每日精选可以避免跨日操作错误 - // $chk = $this->clearBeforeTodayDailySelections(); - $chk = $this->getTodayLastDailySelection($address); if (!$chk) { $chk = $this->refreshDailySelectionWithMode($address, 0); @@ -297,10 +294,6 @@ class DailySelectionController extends BaseAuthedController { ); } - private function buyGoodsFree() - { - } - private function decDailySelectionItem($idx, $grid, $count) { $self = myself(); @@ -317,20 +310,6 @@ class DailySelectionController extends BaseAuthedController { return $chk; } - private function clearBeforeTodayDailySelections() - { - $self = myself(); - if (!$self) return; - - $conn = $self->_getMysql(''); - $nowTime = $this->_getNowTime(); - $dayTime = $this->_getDaySeconds($nowTime); - - $sql = "DELETE FROM t_shop_dailyselection WHERE refresh_time < $dayTime"; - $chk = $conn->execScript($sql); - return $chk; - } - private function countTodayRefreshTimes($address) { $self = myself();