diff --git a/sql/gamedb.sql b/sql/gamedb.sql index d1e0e910..d22ed1f6 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1278,6 +1278,25 @@ CREATE TABLE `t_user_honor` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `t_orderid` +-- + +DROP TABLE IF EXISTS `t_orderid`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_orderid` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', + `request` mediumblob COMMENT 'request', + `confirmed` int(11) NOT NULL DEFAULT '0' COMMENT '是否已确认', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + KEY `account_id` (`account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `t_inapp_record` -- diff --git a/webapp/models/OrderId.php b/webapp/models/OrderId.php new file mode 100644 index 00000000..415e6fb7 --- /dev/null +++ b/webapp/models/OrderId.php @@ -0,0 +1,27 @@ +_getSelfMysql(), + 't_orderid', + array( + 'account_id' => myself()->_getAccountId(), + 'request' => json_encode($_REQUEST), + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + $lastIdx = SqlHelper::getLastInsertId(myself()->_getSelfMysql()); + $orderId = strftime('%Y%m%d%H%M%S', myself()->_getNowTime()) . pad($lastIdx % 100000, 5); + return $orderId; + } + +}