This commit is contained in:
aozhiwei 2023-08-03 08:18:01 +08:00
parent 05bcd74c39
commit 158332f4c7
4 changed files with 14 additions and 72 deletions

View File

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

View File

@ -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)
{

View File

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

View File

@ -1,41 +0,0 @@
<?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(),
)
);
}
}