diff --git a/doc/DailySelection.py b/doc/DailySelection.py index d6aad094..84580c3b 100644 --- a/doc/DailySelection.py +++ b/doc/DailySelection.py @@ -7,7 +7,7 @@ class DailySelection(object): def __init__(self): self.apis = [ { - 'name': 'getDailySelectionList', + 'name': 'info', 'desc': '获取每日精选列表', 'group': 'DailySelection', 'url': 'webapp/index.php?c=DailySelection&a=getDailySelectionList', @@ -22,7 +22,7 @@ class DailySelection(object): ] }, { - 'name': 'refreshDailySelection', + 'name': 'refresh', 'desc': '刷新每日精选', 'group': 'DailySelection', 'url': 'webapp/index.php?c=DailySelection&a=refreshDailySelection', diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 06e7f571..3d582373 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1377,13 +1377,13 @@ CREATE TABLE `t_outapp_order` ( /*!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 character_set_client = utf8 */; -CREATE TABLE `t_dailyselection` ( +CREATE TABLE `t_daily_selection` ( `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-手动刷新时间', diff --git a/webapp/controller/DailySelectionController.class.php b/webapp/controller/DailySelectionController.class.php index 9ed09548..dbf0cc76 100644 --- a/webapp/controller/DailySelectionController.class.php +++ b/webapp/controller/DailySelectionController.class.php @@ -4,16 +4,42 @@ require_once('mt/Item.php'); require_once('mt/Parameter.php'); require_once('mt/Dailyselection.php'); +require_once('models/DailySelection.php'); + require_once('services/AwardService.php'); require_once('services/PropertyChgService.php'); - require_once('services/LogService.php'); +use models\DailySelection; + use services\LogService; 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(); @@ -60,7 +86,6 @@ class DailySelectionController extends BaseAuthedController { $this->_rspData( array( - 'idx' => $selection['idx'], 'refresh_info' => "{$count}/{$max_count}", 'cost' => $cost, 'goods_list' => $goodsList, @@ -68,7 +93,7 @@ class DailySelectionController extends BaseAuthedController { ); } - public function refreshDailySelection() + public function refreshDailySelectionOld() { $address = $this->_getAccountId(); @@ -106,7 +131,7 @@ class DailySelectionController extends BaseAuthedController { } } - public function buyGoodsDS() + public function buyGoodsDSOld() { $idx = getReqVal('idx', 0); if ($idx <= 0) { diff --git a/webapp/models/DailySelection.php b/webapp/models/DailySelection.php new file mode 100644 index 00000000..febd1c37 --- /dev/null +++ b/webapp/models/DailySelection.php @@ -0,0 +1,41 @@ +_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(), + ) + ); + } + +}