3333
This commit is contained in:
parent
606693a475
commit
1091654b7c
@ -2,6 +2,7 @@ package dao
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"gorm.io/gorm/clause"
|
"gorm.io/gorm/clause"
|
||||||
"hepa-calc-api/api/model"
|
"hepa-calc-api/api/model"
|
||||||
@ -186,6 +187,7 @@ func (r *QuestionDao) GetQuestionPageSearch(req requests.GetQuestionPage, page,
|
|||||||
|
|
||||||
// 搜索关键字
|
// 搜索关键字
|
||||||
if req.Keyword != "" {
|
if req.Keyword != "" {
|
||||||
|
fmt.Println(111)
|
||||||
keyword := "%" + req.Keyword + "%" //
|
keyword := "%" + req.Keyword + "%" //
|
||||||
|
|
||||||
// 标题
|
// 标题
|
||||||
@ -204,7 +206,11 @@ func (r *QuestionDao) GetQuestionPageSearch(req requests.GetQuestionPage, page,
|
|||||||
Where(gorm.Expr("class_id IN (?)", baseClassSubQuery))
|
Where(gorm.Expr("class_id IN (?)", baseClassSubQuery))
|
||||||
|
|
||||||
orQuery = orQuery.Or(gorm.Expr("question_id IN (?)", questionClassSubQuery))
|
orQuery = orQuery.Or(gorm.Expr("question_id IN (?)", questionClassSubQuery))
|
||||||
|
|
||||||
|
// 执行组建
|
||||||
|
query = query.Where(orQuery)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 排序
|
// 排序
|
||||||
if req.Order != nil {
|
if req.Order != nil {
|
||||||
// 点击次数(点击进入详情页的人次)
|
// 点击次数(点击进入详情页的人次)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user