Merge branch 'dev' into feat/cut-text

This commit is contained in:
kumfo 2022-11-07 16:06:05 +08:00
commit d40e686b73
2 changed files with 15 additions and 8 deletions

View File

@ -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

View File

@ -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
}