Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5af4f1c3
authored
Dec 04, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加执行关闭
parent
b1160282
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
cmd/static/main.go
internal/dao/scores.go
cmd/static/main.go
View file @
5af4f1c3
...
...
@@ -97,6 +97,7 @@ func InsertRecord(c context.Context) {
//if !math.IsNaN(CurrentScore64) && CurrentScore64 != 0 {
//}
insertId
,
err
:=
svc
.
InsertScores
(
c
,
insertScoreMsgRecord
)
fmt
.
Print
(
c
)
fmt
.
Print
(
err
)
fmt
.
Print
(
insertId
)
}
...
...
internal/dao/scores.go
View file @
5af4f1c3
...
...
@@ -32,8 +32,8 @@ func (d *dao) InsertScores(ctx context.Context,score model.Scores) (insertId int
}
}
else
{
execSql
=
"update `lie_scores` set `type` = ?, `project_pid` = ?, `project_id` = ?, `total_score` = ?, `current_score` = ?, `weight` = ?, `final_score` = ?, `
com_credits_id` = ?, `
update_time` = ? where `type` = ? and project_pid = ? and project_id = ? and com_credits_id = ?"
row
,
err
:=
d
.
db
.
Exec
(
ctx
,
execSql
,
score
.
Type
,
score
.
ProjectPid
,
score
.
ProjectId
,
score
.
TotalScore
,
score
.
CurrentScore
,
score
.
Weight
,
score
.
FinalScore
,
score
.
ComCreditsId
,
time
.
Now
()
.
Unix
(),
score
.
Type
,
score
.
ProjectPid
,
score
.
ProjectId
,
score
.
ComCreditsId
)
execSql
=
"update `lie_scores` set `type` = ?, `project_pid` = ?, `project_id` = ?, `total_score` = ?, `current_score` = ?, `weight` = ?, `final_score` = ?, `update_time` = ? where `type` = ? and project_pid = ? and project_id = ? and com_credits_id = ?"
row
,
err
:=
d
.
db
.
Exec
(
ctx
,
execSql
,
score
.
Type
,
score
.
ProjectPid
,
score
.
ProjectId
,
score
.
TotalScore
,
score
.
CurrentScore
,
score
.
Weight
,
score
.
FinalScore
,
time
.
Now
()
.
Unix
(),
score
.
Type
,
score
.
ProjectPid
,
score
.
ProjectId
,
score
.
ComCreditsId
)
if
err
!=
nil
{
log
.
Error
(
"updateScoresdb.DemoExec.Exec(%s) error(%v)"
,
execSql
,
err
)
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment