mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-01-07 13:39:43 +02:00
сделал constants_
This commit is contained in:
parent
ad2b030a9c
commit
b5fd8053b4
@ -237,7 +237,7 @@ func Delete_ctx(ctx context.Context, db *gorm.DB, m *lawsuit_status_types.Lawsui
|
|||||||
}
|
}
|
||||||
|
|
||||||
m2 := lawsuit_status_types.LawsuitStatusType{}
|
m2 := lawsuit_status_types.LawsuitStatusType{}
|
||||||
m2.ID = m.ID
|
m2.ID = int64(m.ID)
|
||||||
err = Read_ctx(ctx, db, &m2)
|
err = Read_ctx(ctx, db, &m2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 := lawsuit_status_types.LawsuitStatusType{}
|
||||||
m2.ID = m.ID
|
m2.ID = int64(m.ID)
|
||||||
err = Read_ctx(ctx, db, &m2)
|
err = Read_ctx(ctx, db, &m2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -234,10 +234,11 @@ func ReplacePrimaryKeyM_ID(Text string, Table1 *types.Table) string {
|
|||||||
//заменим ID-Alias на ID
|
//заменим ID-Alias на ID
|
||||||
TableName := Table1.Name
|
TableName := Table1.Name
|
||||||
IDName, _ := FindPrimaryKeyNameType(Table1)
|
IDName, _ := FindPrimaryKeyNameType(Table1)
|
||||||
_, ok := types.MapConvertID[TableName+"."+IDName]
|
Alias, ok := types.MapConvertID[TableName+"."+IDName]
|
||||||
OtvetColumnName := "m." + ColumnName
|
OtvetColumnName := "m." + ColumnName
|
||||||
if ok == true {
|
if ok == true {
|
||||||
OtvetColumnName = ColumnTypeGo + "(" + OtvetColumnName + ")"
|
OtvetColumnName = Alias + "(" + OtvetColumnName + ")"
|
||||||
|
//OtvetColumnName = ColumnTypeGo + "(" + OtvetColumnName + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
//заменим int64(m.ID) на m.ID
|
//заменим int64(m.ID) на m.ID
|
||||||
|
Loading…
Reference in New Issue
Block a user