WH01243 2 rokov pred
rodič
commit
60d69f3b7f
1 zmenil súbory, kde vykonal 6 pridanie a 0 odobranie
  1. 6 0
      entity/ent.go

+ 6 - 0
entity/ent.go

@@ -274,6 +274,12 @@ func (this *EntInfo) Update() bool {
 		ok_1 := this.Mysql.UpdateByTx(tx, Entniche_info, map[string]interface{}{
 			"id": this.Id,
 		}, m)
+		if this.Name != "" {
+			this.Mysql.UpdateByTx(tx, Entniche_department, map[string]interface{}{
+				"ent_id": this.Id,
+				"pid":    0,
+			}, map[string]interface{}{"name": this.Name})
+		}
 		AuthRecordId := this.Mysql.InsertByTx(tx, Auth_record, map[string]interface{}{
 			"entId":            this.Id,
 			"creditCode":       this.Code,