This commit is contained in:
aozhiwei 2023-08-02 21:26:03 +08:00
parent c2ff3a529b
commit fd634e80ce
4 changed files with 33 additions and 28 deletions

View File

@ -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(), '链上购买订单信息']
]
}
]

View File

@ -471,7 +471,6 @@ class DailySelectionGoods(object):
['token_type', '', '代币类型(4|0)'],
['discount', '', '折扣(95|80)'],
['price', '', '价格(100|100000)'],
['pending', 0, '购买中...'],
]
class Mission(object):

View File

@ -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',

View File

@ -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();