mirror of https://gitee.com/answerdev/answer.git
Merge branch 'dev' into feat/cut-text
This commit is contained in:
commit
d40e686b73
|
@ -38,9 +38,7 @@ stages:
|
|||
stage: push
|
||||
extends: .docker-build-push
|
||||
only:
|
||||
- dev
|
||||
- master
|
||||
- main
|
||||
- test
|
||||
variables:
|
||||
DockerNamespace: sf_app
|
||||
DockerImage: answer
|
||||
|
@ -52,7 +50,7 @@ stages:
|
|||
stage: deploy-dev
|
||||
extends: .deploy-helm
|
||||
only:
|
||||
- main
|
||||
- test
|
||||
variables:
|
||||
LoadBalancerIP: 10.0.10.98
|
||||
KubernetesCluster: dev
|
||||
|
|
|
@ -143,13 +143,22 @@ func (sr *searchRepo) SearchContents(ctx context.Context, words []string, tagID,
|
|||
argsA = append(argsA, votes)
|
||||
}
|
||||
|
||||
b = b.Union("all", ub)
|
||||
|
||||
querySQL, _, err := builder.MySQL().Select("*").From(b, "t").OrderBy(sr.parseOrder(ctx, order)).Limit(size, page-1).ToSQL()
|
||||
//b = b.Union("all", ub)
|
||||
ubSQL, _, err := ub.ToSQL()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
countSQL, _, err := builder.MySQL().Select("count(*) total").From(b, "c").ToSQL()
|
||||
bSQL, _, err := b.ToSQL()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
sql := fmt.Sprintf("(%s UNION ALL %s)", ubSQL, bSQL)
|
||||
|
||||
querySQL, _, err := builder.MySQL().Select("*").From(sql, "t").OrderBy(sr.parseOrder(ctx, order)).Limit(size, page-1).ToSQL()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
countSQL, _, err := builder.MySQL().Select("count(*) total").From(sql, "c").ToSQL()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue