Commit 6545a04e by Joneq

修改defer的位置

parent f04f6aa4
......@@ -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()
......
......@@ -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)
......
......@@ -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
}
......
......@@ -32,7 +32,6 @@ func (d *dao) GetModelTopsetByProjectId(c context.Context, projectId int64) (res
res = v
break
}
defer d.db.Close()
return
}
......@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment