Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2019-1-OpenSourceSW
/
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
routes/index.js
routes/index.js
View file @
de17b8b
...
...
@@ -19,13 +19,21 @@ 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
)
{
if
(
err
)
{
console
.
log
(
err
);
}
else
{
if
(
rows
.
length
==
0
)
{
}
else
{
if
(
rows
.
length
==
0
)
{
empty
=
1
;
}
else
{
for
(
var
i
=
rows
.
length
-
1
;
i
>=
0
;
i
--
){
}
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
);
...
...
@@ -37,6 +45,7 @@ router.get('/', function(req, res, next) {
break
;
}
}
}
dataLen
=
probArr
.
length
;
res
.
render
(
'index'
,
{
...
...
@@ -49,8 +58,7 @@ router.get('/', function(req, res, next) {
dataLen
});
}
}
});
});
});
module
.
exports
=
router
;
...
...
Please
register
or
login
to post a comment