Toggle navigation
Toggle navigation
This project
Loading...
Sign in
조인화
/
Probability Death
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
배희수
2018-12-11 19:23:47 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
de17b8ba134f0767a63d65c996d0ed1e4229dfd9
de17b8ba
2 parents
91daa8ed
a1600051
Merge branch 'al_new' into 'developing'
fix error on rendering part See merge request !9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
routes/index.js
routes/index.js
View file @
de17b8b
...
...
@@ -19,22 +19,31 @@ router.get('/', function(req, res, next) {
// 이전 10분간 데이터 찾기
sql
=
"SELECT * FROM weatherInfo WHERE time >= DATE_FORMAT(DATE_ADD(now(), INTERVAL -20 MINUTE), '%Y-%m-%d %H:%i:%s')"
;
db
.
query
(
sql
,
function
(
err
,
rows
,
fields
){
if
(
err
)
{
console
.
log
(
err
);
}
else
{
if
(
rows
.
length
==
0
)
{
empty
=
1
;
}
else
{
for
(
var
i
=
rows
.
length
-
1
;
i
>=
0
;
i
--
){
probArr
.
unshift
(
rows
[
i
].
prob
);
time
.
unshift
(
rows
[
i
].
time
);
ptArr
.
unshift
(
rows
[
i
].
temperature
);
wsArr
.
unshift
(
rows
[
i
].
wind
);
rainArr
.
unshift
(
rows
[
i
].
rain
);
count
=
count
+
1
;
if
(
err
)
{
console
.
log
(
err
);
}
else
{
if
(
rows
.
length
==
0
)
{
empty
=
1
;
}
else
{
for
(
var
i
=
rows
.
length
-
1
;
i
>=
0
;
i
--
)
{
console
.
log
(
'kk'
);
probArr
.
unshift
(
rows
[
i
].
prob
);
time
.
unshift
(
rows
[
i
].
time
);
ptArr
.
unshift
(
rows
[
i
].
temperature
);
wsArr
.
unshift
(
rows
[
i
].
wind
);
rainArr
.
unshift
(
rows
[
i
].
rain
);
count
=
count
+
1
;
if
(
count
==
10
){
break
;
if
(
count
==
10
){
break
;
}
}
}
...
...
@@ -49,8 +58,7 @@ router.get('/', function(req, res, next) {
dataLen
});
}
}
});
});
});
module
.
exports
=
router
;
...
...
Please
register
or
login
to post a comment