File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ func ListHomePage(c *fiber.Ctx) (err error) {
7373 // 仿照 ListHoles:按 Tags 过滤(需同时拥有所有指定标签的树洞)
7474 if len (query .Tags ) != 0 {
7575 var tags []Tag
76- err = tx .Where ("name IN ?" , query .Tags ).Find (& tags ).Error
76+ err = tx .Model ( & Tag {}). Where ("name IN ?" , query .Tags ).Find (& tags ).Error
7777 if err != nil {
7878 return err
7979 }
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ type Division struct {
3636
3737func HomepageDivisionIDs (tx * gorm.DB , excludeDivisionIDs * []int ) (divisionIDs []int , err error ) {
3838 if excludeDivisionIDs != nil {
39- err = tx .Select ("id" ).Where ("show_in_home_page = ? AND id NOT IN ?" , true , excludeDivisionIDs ).Find (& divisionIDs ).Error
39+ err = tx .Model ( & Division {}). Select ("id" ).Where ("show_in_home_page = ? AND id NOT IN ?" , true , excludeDivisionIDs ).Find (& divisionIDs ).Error
4040 return
4141 }
4242
43- err = tx .Select ("id" ).Where ("show_in_home_page = ?" , true ).Find (& divisionIDs ).Error
43+ err = tx .Model ( & Division {}). Select ("id" ).Where ("show_in_home_page = ?" , true ).Find (& divisionIDs ).Error
4444 return
4545}
4646
You can’t perform that action at this time.
0 commit comments