mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-02-17 08:04:09 +02:00
сделал refactoring
This commit is contained in:
parent
4b674db9b3
commit
5a84dd2719
@ -2867,3 +2867,17 @@ func CommentLineInText(Text, TextFind string) string {
|
||||
|
||||
return Otvet
|
||||
}
|
||||
|
||||
// Find_ColumnNamesWithComma - возвращает строку с именами колонок БД, через запятую
|
||||
func Find_ColumnNamesWithComma(MassColumns []*types.Column) string {
|
||||
Otvet := ""
|
||||
|
||||
Comma := ""
|
||||
for _, v := range MassColumns {
|
||||
Otvet = Otvet + Comma + v.Name
|
||||
|
||||
Comma = ", "
|
||||
}
|
||||
|
||||
return Otvet
|
||||
}
|
||||
|
@ -153,10 +153,17 @@ func CreateFilesFindMassByTable1(Table1 *types.Table, TextTemplateFunction strin
|
||||
Comma = ", "
|
||||
}
|
||||
|
||||
//кроме помеченных на удаление
|
||||
if create_files.Has_Column_IsDeleted_Bool(Table1) == true {
|
||||
TextWhere = TextWhere + "\t" + `tx = tx.Where("is_deleted = ?", false)` + "\n"
|
||||
}
|
||||
|
||||
//
|
||||
if len(MassColumns1) == 0 {
|
||||
FuncName := constants.TEXT_READALL
|
||||
Otvet = strings.ReplaceAll(Otvet, "FindMassBy_FieldNamesWithUnderline", FuncName)
|
||||
ColumnsPK := create_files.Find_PrimaryKeyColumns(Table1)
|
||||
ColumnNamesWithComma = create_files.Find_ColumnNamesWithComma(ColumnsPK)
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user