1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-11-24 08:22:42 +02:00

сделал IntFromAlias

This commit is contained in:
Nikitin Aleksandr 2024-05-16 13:06:18 +03:00
parent 7506d6b37a
commit 1bb0e0ae0a

View File

@ -276,12 +276,12 @@ func ReplacePrimaryKeyM_ID(Text string, Table1 *types.Table) string {
//Alias преобразуем в int64, и наоборот
if Alias != "" {
Otvet = strings.ReplaceAll(Otvet, "IntFromAlias(m.ID)", ColumnTypeGoPK+"(m."+ColumnNamePK+")")
Otvet = strings.ReplaceAll(Otvet, "IntToAlias(m.ID)", OtvetColumnName)
Otvet = strings.ReplaceAll(Otvet, "IntToAlias(ID)", Alias+"("+ColumnNamePK+")")
Otvet = strings.ReplaceAll(Otvet, "AliasFromInt(m.ID)", OtvetColumnName)
Otvet = strings.ReplaceAll(Otvet, "AliasFromInt(ID)", Alias+"("+ColumnNamePK+")")
} else {
Otvet = strings.ReplaceAll(Otvet, "IntFromAlias(m.ID)", "m."+ColumnNamePK+"")
Otvet = strings.ReplaceAll(Otvet, "IntToAlias(m.ID)", OtvetColumnName)
Otvet = strings.ReplaceAll(Otvet, "IntToAlias(ID)", "ID")
Otvet = strings.ReplaceAll(Otvet, "AliasFromInt(m.ID)", OtvetColumnName)
Otvet = strings.ReplaceAll(Otvet, "AliasFromInt(ID)", "ID")
}
return Otvet