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:22:22 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a160005120d4fda628269263a57472d86c7ee2c5
a1600051
1 parent
567b8445
렌더링 오류 수정
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 @
a160005
...
...
@@ -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