1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2025-01-06 01:23:15 +02:00

сделал constants_

This commit is contained in:
Nikitin Aleksandr 2024-05-14 18:06:51 +03:00
parent ad2b030a9c
commit b5fd8053b4
2 changed files with 5 additions and 4 deletions

View File

@ -237,7 +237,7 @@ func Delete_ctx(ctx context.Context, db *gorm.DB, m *lawsuit_status_types.Lawsui
}
m2 := lawsuit_status_types.LawsuitStatusType{}
m2.ID = m.ID
m2.ID = int64(m.ID)
err = Read_ctx(ctx, db, &m2)
if err != nil {
return err
@ -278,7 +278,7 @@ func Restore_ctx(ctx context.Context, db *gorm.DB, m *lawsuit_status_types.Lawsu
}
m2 := lawsuit_status_types.LawsuitStatusType{}
m2.ID = m.ID
m2.ID = int64(m.ID)
err = Read_ctx(ctx, db, &m2)
if err != nil {
return err

View File

@ -234,10 +234,11 @@ func ReplacePrimaryKeyM_ID(Text string, Table1 *types.Table) string {
//заменим ID-Alias на ID
TableName := Table1.Name
IDName, _ := FindPrimaryKeyNameType(Table1)
_, ok := types.MapConvertID[TableName+"."+IDName]
Alias, ok := types.MapConvertID[TableName+"."+IDName]
OtvetColumnName := "m." + ColumnName
if ok == true {
OtvetColumnName = ColumnTypeGo + "(" + OtvetColumnName + ")"
OtvetColumnName = Alias + "(" + OtvetColumnName + ")"
//OtvetColumnName = ColumnTypeGo + "(" + OtvetColumnName + ")"
}
//заменим int64(m.ID) на m.ID