作者 tangxvhui

bug修复

@@ -118,6 +118,10 @@ func UpdateCompanyData(data ModuleCompanytData) error { @@ -118,6 +118,10 @@ func UpdateCompanyData(data ModuleCompanytData) error {
118 ) 118 )
119 newCompanyData := data.Company 119 newCompanyData := data.Company
120 companyData, err = models.GetCompanyByUCenter(newCompanyData.AdminCompanyId) 120 companyData, err = models.GetCompanyByUCenter(newCompanyData.AdminCompanyId)
  121 + if err == orm.ErrNoRows {
  122 + log.Error("编辑操作,未找到数据,执行添加操作")
  123 + return AddCompanyData(data)
  124 + }
121 if err != nil { 125 if err != nil {
122 log.Error("获取企业数据失败,user_center_id:%d ,err:%s", newCompanyData.AdminCompanyId, err) 126 log.Error("获取企业数据失败,user_center_id:%d ,err:%s", newCompanyData.AdminCompanyId, err)
123 return errors.New("获取企业数据失败") 127 return errors.New("获取企业数据失败")