From 684e4b20b21c7014a9b865b880c35099dbe083cf Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 6 Nov 2024 17:14:17 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 1 + webapp/controller/ToolsController.class.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index c72fe6f5..13ed647b 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -2305,6 +2305,7 @@ DROP TABLE IF EXISTS `t_android`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_android` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `robot_id` int(11) NOT NULL DEFAULT '0' COMMENT 'robot_id', `name` varchar(60) NOT NULL DEFAULT '' COMMENT 'name', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/webapp/controller/ToolsController.class.php b/webapp/controller/ToolsController.class.php index 71d5c548..b8d08769 100644 --- a/webapp/controller/ToolsController.class.php +++ b/webapp/controller/ToolsController.class.php @@ -559,7 +559,8 @@ class ToolsController extends BaseController { public function genAndroid() { mt\Robot::traverse(function ($meta) { - echo 'INSERT INTO t_android(name, createtime, modifytime)VALUES(`' . $meta['name'] . '`,' . myself()->_getNowTime() . ',' . myself()->_getNowTime() . ");\n"; + echo 'INSERT INTO t_android(robot_id, name, createtime, modifytime)VALUES(' + . $meta['id'] . ",'" . $meta['name'] . "'," . myself()->_getNowTime() . ',' . myself()->_getNowTime() . ");\n"; return true; }); }