Commit f605ae1a by Joneq

增加日志几率

parent 7f8d94fd
Showing with 5 additions and 5 deletions
...@@ -55,13 +55,13 @@ func GetCompanyInfo(c *bm.Context) { ...@@ -55,13 +55,13 @@ func GetCompanyInfo(c *bm.Context) {
companyName,_ := c.Params.Get("company_name") companyName,_ := c.Params.Get("company_name")
db,closedb,err := dao.NewDB() db,closedb,err := dao.NewDB()
if err != nil { if err != nil {
fmt.Println(err) log.Error(err.Error())
} }
err = db.QueryRow(c,SELECTERPCOMBASIC,companyName).Scan(&erpCompanyInfo.ComName,&erpCompanyInfo.ComOrganization,&erpCompanyInfo.EstanlishmentTime, err = db.QueryRow(c,SELECTERPCOMBASIC,companyName).Scan(&erpCompanyInfo.ComName,&erpCompanyInfo.ComOrganization,&erpCompanyInfo.EstanlishmentTime,
&erpCompanyInfo.CustomerProperty,&erpCompanyInfo.RegisteredCapital,&erpCompanyInfo.LegalRepresentative,&erpCompanyInfo.TianyanchaJson,&erpCompanyInfo.ComAddress) &erpCompanyInfo.CustomerProperty,&erpCompanyInfo.RegisteredCapital,&erpCompanyInfo.LegalRepresentative,&erpCompanyInfo.TianyanchaJson,&erpCompanyInfo.ComAddress)
if err != nil { if err != nil {
fmt.Println(err) log.Error(err.Error())
} }
jsonArr := strings.Split(erpCompanyInfo.TianyanchaJson,"||||") jsonArr := strings.Split(erpCompanyInfo.TianyanchaJson,"||||")
...@@ -98,14 +98,14 @@ func PushCompanyMq(c *bm.Context,companyName string) { ...@@ -98,14 +98,14 @@ func PushCompanyMq(c *bm.Context,companyName string) {
currentTime := time.Now().Unix() currentTime := time.Now().Unix()
sqlResult,err := db.Exec(c,member.INSERTCOMPANY,companyName,currentTime,currentTime) sqlResult,err := db.Exec(c,member.INSERTCOMPANY,companyName,currentTime,currentTime)
lastid,_ := sqlResult.LastInsertId() lastid,err := sqlResult.LastInsertId()
//如果添加没问题,就继续添加 //如果添加没问题,就继续添加
if err != nil { if err != nil {
fmt.Println(err) log.Error(err.Error())
}else{ }else{
_,err = db.Exec(c,member.INSERTCOMPANYBASICINFO,lastid,companyName,currentTime) _,err = db.Exec(c,member.INSERTCOMPANYBASICINFO,lastid,companyName,currentTime)
if err != nil { if err != nil {
fmt.Println(err) log.Error(err.Error())
} }
} }
......
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