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
6545a04e
authored
Dec 11, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改defer的位置
parent
f04f6aa4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
7 deletions
internal/dao/com_basicinfos.go
internal/dao/com_credits.go
internal/dao/model_items.go
internal/dao/model_topset.go
internal/dao/scores.go
internal/dao/com_basicinfos.go
View file @
6545a04e
...
...
@@ -49,7 +49,6 @@ func (d *dao) GetCompanyBaseInfoByCid(c context.Context, companyId int64) (res m
func
(
d
*
dao
)
UpdateCompanyBaseInfoForTyc
(
c
context
.
Context
,
updateInfo
map
[
string
]
string
)
(
res
int64
)
{
var
(
execSql
string
rows
*
sql
.
Rows
)
execSql
=
"update `lie_com_basicinfos` set `customer_property` = ?, `establishment_time` = ?, `five_legal_change` = ?, `registered_capital` = ?, `social_security_participants` = ?, `two_years_no_lawsuit` = ? , `tyc_select_num` = ? , `tianyancha_json` = ? where com_credits_id = ? "
row
,
err
:=
d
.
db
.
Exec
(
c
,
execSql
,
updateInfo
[
"customer_property"
],
updateInfo
[
"establishment_time"
],
updateInfo
[
"five_legal_change"
],
updateInfo
[
"registered_capital"
],
updateInfo
[
"social_security_participants"
],
updateInfo
[
"two_years_no_lawsuit"
],
updateInfo
[
"tyc_select_num"
],
updateInfo
[
"tianyancha_json"
],
updateInfo
[
"com_credits_id"
])
...
...
@@ -57,7 +56,6 @@ func (d *dao)UpdateCompanyBaseInfoForTyc(c context.Context,updateInfo map[string
log
.
Error
(
"updateScoresdb.DemoExec.Exec(%s) error(%v)"
,
execSql
,
err
)
}
defer
rows
.
Close
()
affectNum
,
err
:=
row
.
RowsAffected
()
...
...
internal/dao/com_credits.go
View file @
6545a04e
...
...
@@ -81,6 +81,8 @@ func (d *dao)UpdateComCredits(ctx context.Context,com_credits model.ComCredits)(
err
=
errors
.
WithStack
(
err
)
return
}
defer
rows
.
Close
()
if
err
!=
nil
{
...
...
@@ -88,7 +90,6 @@ func (d *dao)UpdateComCredits(ctx context.Context,com_credits model.ComCredits)(
return
}
defer
rows
.
Close
()
twoMap
,
err
:=
GetAllParam
(
rows
)
...
...
internal/dao/model_items.go
View file @
6545a04e
...
...
@@ -33,9 +33,6 @@ func (d *dao) GetCompanyModelItemsByProjectid(c context.Context, project_id int6
res
=
v
break
}
defer
d
.
db
.
Close
()
fmt
.
Print
(
res
)
return
}
...
...
internal/dao/model_topset.go
View file @
6545a04e
...
...
@@ -32,7 +32,6 @@ func (d *dao) GetModelTopsetByProjectId(c context.Context, projectId int64) (res
res
=
v
break
}
defer
d
.
db
.
Close
()
return
}
internal/dao/scores.go
View file @
6545a04e
...
...
@@ -24,6 +24,7 @@ func (d *dao) InsertScores(ctx context.Context,score model.Scores) (insertId int
fmt
.
Print
(
"save list fail"
)
}
if
exitId
==
0
{
execSql
=
"INSERT INTO `lie_scores` (`type`, `project_pid`, `project_id`, `total_score`, `current_score`, `weight`, `final_score`, `com_credits_id`, `create_time`)VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)"
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
())
...
...
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