政企超链接开始集成

This commit is contained in:
hoteas 2022-02-28 19:08:48 +08:00
parent e1eca90835
commit d847da7591
2 changed files with 7 additions and 2 deletions

View File

@ -483,7 +483,12 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error {
companyData["industry_id"] = industry.GetCeilInt("id")
}
company := this.Db.Get("company", "id", Map{"name": companyData["name"]})
company := this.Db.Get("company", "id", Map{"sn": companyData["sn"]})
//没有则创建
if company == nil {
company = this.Db.Get("company", "id", Map{"name": companyData["name"]})
}
//没有则创建
if company == nil {
//更新两张表
@ -493,7 +498,7 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error {
company = Map{"id": id}
} else {
//有则更新
this.Db.Update("company", companyData, Map{"name": companyData["name"]})
this.Db.Update("company", companyData, Map{"id": company.GetCeilInt("id")})
companyData["company_id"] = company.GetCeilInt("id")
companyData["create_time"] = time.Now().Unix()
}

Binary file not shown.