1
This commit is contained in:
parent
d654bd893c
commit
112e52ec9d
@ -1948,3 +1948,22 @@ CREATE TABLE `t_box_alloc` (
|
||||
KEY `idx_createtime` (`createtime`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `t_middata`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `t_middata`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `t_middata` (
|
||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id',
|
||||
`type` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'type',
|
||||
`data` text COMMENT 'data',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `account_id_type` (`account_id`, `type`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
@ -1,17 +1,13 @@
|
||||
<?php
|
||||
|
||||
require_once('mt/Sign.php');
|
||||
require_once('mt/Parameter.php');
|
||||
|
||||
require_once('models/SignLog.php');
|
||||
|
||||
require_once('services/LogService.php');
|
||||
require_once('services/AwardService.php');
|
||||
require_once('services/PropertyChgService.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use models\User;
|
||||
use models\SignLog;
|
||||
use services\LogService;
|
||||
|
||||
class BigwheelController extends BaseAuthedController
|
||||
|
47
webapp/models/MidData.php
Normal file
47
webapp/models/MidData.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace models;
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
|
||||
class MidData extends BaseModel {
|
||||
|
||||
public static function getData($type)
|
||||
{
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_middata',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'type' => $type,
|
||||
)
|
||||
);
|
||||
return $row ? json_decode($row['data'], true) : null;
|
||||
}
|
||||
|
||||
|
||||
public static function setData($type, $data)
|
||||
{
|
||||
SqlHelper::upsert
|
||||
(myself()->_getSelfMysql(),
|
||||
't_middata',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'type' => $type
|
||||
),
|
||||
array(
|
||||
'data' => $data,
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
),
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'type' => $type,
|
||||
'data' => $data,
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user