mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 17:40:55 +00:00
commit
25bec8bbe9
@ -266,7 +266,10 @@ func bootStrap() {
|
|||||||
if found == false {
|
if found == false {
|
||||||
mForC:
|
mForC:
|
||||||
for _, ffi := range fi.relModelInfo.fields.fieldsByType[RelManyToMany] {
|
for _, ffi := range fi.relModelInfo.fields.fieldsByType[RelManyToMany] {
|
||||||
if ffi.relModelInfo == mi {
|
conditions := fi.relThrough != "" && fi.relThrough == ffi.relThrough ||
|
||||||
|
fi.relTable != "" && fi.relTable == ffi.relTable ||
|
||||||
|
fi.relThrough == "" && fi.relTable == ""
|
||||||
|
if ffi.relModelInfo == mi && conditions {
|
||||||
found = true
|
found = true
|
||||||
|
|
||||||
fi.reverseField = ffi.reverseFieldInfoTwo.name
|
fi.reverseField = ffi.reverseFieldInfoTwo.name
|
||||||
|
@ -223,6 +223,11 @@ checkType:
|
|||||||
break checkType
|
break checkType
|
||||||
case "many":
|
case "many":
|
||||||
fieldType = RelReverseMany
|
fieldType = RelReverseMany
|
||||||
|
if tv := tags["rel_table"]; tv != "" {
|
||||||
|
fi.relTable = tv
|
||||||
|
} else if tv := tags["rel_through"]; tv != "" {
|
||||||
|
fi.relThrough = tv
|
||||||
|
}
|
||||||
break checkType
|
break checkType
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("error")
|
err = fmt.Errorf("error")
|
||||||
|
Loading…
Reference in New Issue
Block a user