1
This commit is contained in:
parent
a5e4c21c63
commit
ea6f77d65f
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user