diff --git a/webapp/controller/ToolsController.class.php b/webapp/controller/ToolsController.class.php index 6bdf259f..ebfc12fc 100644 --- a/webapp/controller/ToolsController.class.php +++ b/webapp/controller/ToolsController.class.php @@ -545,4 +545,27 @@ class ToolsController extends BaseController { }); } + public function updateAndroid() + { + $data = array(); + mt\Robot::traverse(function ($meta) use(&$data) { + $row = SqlHelper::ormSelectOne + ($this->_getMysql(''), + 't_android', + array( + 'name' => $meta['name'] + ) + ); + if (array_key_exists($meta['name'], $data)) { + return true; + } + $data[$meta['name']] = $meta; + if (!$row) { + echo 'INSERT INTO t_android(robot_id, name, createtime, modifytime)VALUES(' + . $meta['id'] . ",'" . $meta['name'] . "'," . myself()->_getNowTime() . ',' . myself()->_getNowTime() . ");\n"; + } + return true; + }); + } + }