This commit is contained in:
aozhiwei 2023-08-02 22:01:45 +08:00
parent 6c09f89e65
commit 05bcd74c39
4 changed files with 76 additions and 10 deletions

View File

@ -7,7 +7,7 @@ class DailySelection(object):
def __init__(self): def __init__(self):
self.apis = [ self.apis = [
{ {
'name': 'getDailySelectionList', 'name': 'info',
'desc': '获取每日精选列表', 'desc': '获取每日精选列表',
'group': 'DailySelection', 'group': 'DailySelection',
'url': 'webapp/index.php?c=DailySelection&a=getDailySelectionList', 'url': 'webapp/index.php?c=DailySelection&a=getDailySelectionList',
@ -22,7 +22,7 @@ class DailySelection(object):
] ]
}, },
{ {
'name': 'refreshDailySelection', 'name': 'refresh',
'desc': '刷新每日精选', 'desc': '刷新每日精选',
'group': 'DailySelection', 'group': 'DailySelection',
'url': 'webapp/index.php?c=DailySelection&a=refreshDailySelection', 'url': 'webapp/index.php?c=DailySelection&a=refreshDailySelection',

View File

@ -1377,13 +1377,13 @@ CREATE TABLE `t_outapp_order` (
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
-- Table structure for table `t_dailyselection` -- Table structure for table `t_daily_selection`
-- --
DROP TABLE IF EXISTS `t_dailyselection`; DROP TABLE IF EXISTS `t_daily_selection`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_dailyselection` ( CREATE TABLE `t_daily_selection` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id', `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL COMMENT 'account_id', `account_id` varchar(60) NOT NULL COMMENT 'account_id',
`refresh_mode` int(11) NOT NULL COMMENT '0-每日自动刷新时间 1-手动刷新时间', `refresh_mode` int(11) NOT NULL COMMENT '0-每日自动刷新时间 1-手动刷新时间',

View File

@ -4,16 +4,42 @@ require_once('mt/Item.php');
require_once('mt/Parameter.php'); require_once('mt/Parameter.php');
require_once('mt/Dailyselection.php'); require_once('mt/Dailyselection.php');
require_once('models/DailySelection.php');
require_once('services/AwardService.php'); require_once('services/AwardService.php');
require_once('services/PropertyChgService.php'); require_once('services/PropertyChgService.php');
require_once('services/LogService.php'); require_once('services/LogService.php');
use models\DailySelection;
use services\LogService; use services\LogService;
class DailySelectionController extends BaseAuthedController { class DailySelectionController extends BaseAuthedController {
public function getDailySelectionList() public function info()
{
$dbInfo = DailySelection::get();
if (!$dbInfo) {
}
$dbInfo = DailySelection::get();
if (!$dbInfo) {
myself()->_rspErr(500, 'server internal error');
return;
}
}
public function refresh()
{
}
public function buy()
{
}
public function getDailySelectionListOld()
{ {
$address = $this->_getAccountId(); $address = $this->_getAccountId();
@ -60,7 +86,6 @@ class DailySelectionController extends BaseAuthedController {
$this->_rspData( $this->_rspData(
array( array(
'idx' => $selection['idx'],
'refresh_info' => "{$count}/{$max_count}", 'refresh_info' => "{$count}/{$max_count}",
'cost' => $cost, 'cost' => $cost,
'goods_list' => $goodsList, 'goods_list' => $goodsList,
@ -68,7 +93,7 @@ class DailySelectionController extends BaseAuthedController {
); );
} }
public function refreshDailySelection() public function refreshDailySelectionOld()
{ {
$address = $this->_getAccountId(); $address = $this->_getAccountId();
@ -106,7 +131,7 @@ class DailySelectionController extends BaseAuthedController {
} }
} }
public function buyGoodsDS() public function buyGoodsDSOld()
{ {
$idx = getReqVal('idx', 0); $idx = getReqVal('idx', 0);
if ($idx <= 0) { if ($idx <= 0) {

View File

@ -0,0 +1,41 @@
<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class DailySelection extends BaseModel {
public static function get()
{
$row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(),
't_daily_selection',
array(
'account_id' => myself()->_getAccountId(),
)
);
return $row;
}
public static function add()
{
SqlHelper::upsert(
myself()->_getSelfMysql(),
't_daily_selection',
array(
'account_id' => myself()->_getAccountId(),
),
array(
),
array(
'account_id' => myself()->_getAccountId(),
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(),
)
);
}
}