diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 3d582373..42fa5783 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1376,37 +1376,6 @@ 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_daily_selection` --- - -DROP TABLE IF EXISTS `t_daily_selection`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -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-手动刷新时间', - `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/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 79ce9421..f7d7f4c8 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -43,6 +43,7 @@ class BaseAuthedController extends BaseController { protected $accountId = ''; private $sessionId = ''; private $mysqlConn = null; + private $redisConn = null; private $address = null; private $addressActived = false; @@ -202,6 +203,13 @@ class BaseAuthedController extends BaseController { return $this->mysqlConn; } + public function _getSelfRedis() + { + if (!$this->redisConn) { + $this->redisconn = $this->_getRedis($this->_getAccountId()); + } + return $this->redisConn; + } public function _getUserInfo($fields) { diff --git a/webapp/controller/DailySelectionController.class.php b/webapp/controller/DailySelectionController.class.php index dbf0cc76..6718132d 100644 --- a/webapp/controller/DailySelectionController.class.php +++ b/webapp/controller/DailySelectionController.class.php @@ -16,6 +16,8 @@ use services\LogService; class DailySelectionController extends BaseAuthedController { + const MAX_GRID_ID = 6; + public function info() { $dbInfo = DailySelection::get(); @@ -27,6 +29,10 @@ class DailySelectionController extends BaseAuthedController { myself()->_rspErr(500, 'server internal error'); return; } + $data = json_decode($dbInfo); + for ($i = 1; $i <= self::MAX_GRID_ID; ++$i) { + $goodsList[$i] = mt\Dailyselection::get($dbInfo['grid_' . $i]); + } } public function refresh() diff --git a/webapp/models/DailySelection.php b/webapp/models/DailySelection.php deleted file mode 100644 index febd1c37..00000000 --- a/webapp/models/DailySelection.php +++ /dev/null @@ -1,41 +0,0 @@ -_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(), - ) - ); - } - -}