Browse Source

'fix'

master
u 2 years ago
parent
commit
5101728c8c
  1. 22
      hasaki-gen-crud/template.go

22
hasaki-gen-crud/template.go

@ -56,6 +56,11 @@ func (TempLowHead3A60 *Temp3A60) init() {
//todo //todo
} }
func (TempLowHead3A60 *Temp3A60) joinTable() (types, sqlx, condition, alias string) {
//todo
return "LEFT", "", "Temp3A60.id=Temp3A60_id", "tmp"
}
// saveAllCols 保存时是否全量保存 // saveAllCols 保存时是否全量保存
func (TempLowHead3A60 *Temp3A60) isSaveAllCols() bool { func (TempLowHead3A60 *Temp3A60) isSaveAllCols() bool {
return false return false
@ -164,6 +169,12 @@ func (TempLowHead3A60 *Temp3A60) Load() (err error) {
whereCond := TempLowHead3A60.wherePrimaryKeyWithCond() whereCond := TempLowHead3A60.wherePrimaryKeyWithCond()
session := TempLowHead3A60.getXorm().NewSession() session := TempLowHead3A60.getXorm().NewSession()
defer session.Close() defer session.Close()
types, sqlx, condition, alias := TempLowHead3A60.joinTable()
if sqlx != "" {
session = session.Join(types, sqlx, condition, alias)
}
if whereQuery != "" { if whereQuery != "" {
session = session.Where(whereQuery, whereArgs...) session = session.Where(whereQuery, whereArgs...)
} }
@ -194,6 +205,11 @@ func (TempLowHead3A60 *Temp3A60) Data() (data []Temp3A60) {
session.Close() session.Close()
}() }()
types, sqlx, condition, alias := TempLowHead3A60.joinTable()
if sqlx != "" {
session = session.Join(types, sqlx, condition, alias)
}
if q != "" { if q != "" {
session = session.Where(q, args...) session = session.Where(q, args...)
} }
@ -227,6 +243,12 @@ func (TempLowHead3A60 *Temp3A60) PageData(page, pageSize int) (data []Temp3A60,
defer func() { defer func() {
session.Close() session.Close()
}() }()
types, sqlx, condition, alias := TempLowHead3A60.joinTable()
if sqlx != "" {
session = session.Join(types, sqlx, condition, alias)
}
if q != "" { if q != "" {
session = session.Where(q, args...) session = session.Where(q, args...)
} }

Loading…
Cancel
Save