fix in qrzws
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2020-06-02 02:21:33 +02:00
parent bf1a033725
commit c23395555d
2 changed files with 10 additions and 18 deletions

View File

@ -120,12 +120,7 @@ func BuildQuery(config config.Config, qrzdt QrzDatatableInput) (rows *sqlx.Rows,
}
// BuildQueryCountFiltered builds query for counting filtered
<<<<<<< Updated upstream
func BuildQueryCountFiltered(config config.Config, qrzdt QrzDatatableInput) (cnt int, err error) {
searchstatement, err := SetSearchStatement(config, qrzdt)
err = config.Db.Get(&cnt, fmt.Sprintf("SELECT COUNT(*) FROM %s WHERE %s;", config.DbTable, searchstatement))
=======
func BuildQueryCountFiltered(config config.Config, qrzdt DatatableInput) (cnt int, err error) {
searchstatement, err := SetSearchLikeStatement(config, qrzdt)
query := `
@ -134,22 +129,16 @@ func BuildQueryCountFiltered(config config.Config, qrzdt DatatableInput) (cnt in
WHERE %s;`
err = config.Db.Get(&cnt, fmt.Sprintf(query, config.DbTable, searchstatement))
>>>>>>> Stashed changes
return
}
// BuildQueryCountTotal builds query for counting totals
<<<<<<< Updated upstream
func BuildQueryCountTotal(config config.Config, qrzdt QrzDatatableInput) (cnt int, err error) {
err = config.Db.Get(&cnt, fmt.Sprintf("SELECT COUNT(*) FROM %s;", config.DbTable))
=======
func BuildQueryCountTotal(config config.Config, qrzdt DatatableInput) (cnt int, err error) {
query := `
SELECT COUNT(*) FROM %s;
`
err = config.Db.Get(&cnt, fmt.Sprintf(query, config.DbTable))
>>>>>>> Stashed changes
return
}
@ -210,13 +199,8 @@ func SetLimitStatement(config config.Config, qrzdt QrzDatatableInput) (limitstmt
return
}
<<<<<<< Updated upstream
// SetSearchStatement build the where clause in sql statement
func SetSearchStatement(config config.Config, qrzdt QrzDatatableInput) (searchstmt string, err error) {
=======
// SetSearchLikeStatement build the where clause in sql statement
func SetSearchLikeStatement(config config.Config, qrzdt DatatableInput) (searchstmt string, err error) {
>>>>>>> Stashed changes
func SetSearchLikeStatement(config config.Config, qrzdt QrzDatatableInput) (searchstmt string, err error) {
var searchstmtslice []string
if len(qrzdt.Columns) > 0 {
for id, i := range qrzdt.Columns {
@ -234,7 +218,7 @@ func SetSearchLikeStatement(config config.Config, qrzdt DatatableInput) (searchs
}
// SetSearchFTSStatement build the where clause in sql statement
func SetSearchFTSStatement(config config.Config, qrzdt DatatableInput) (searchstmt string, err error) {
func SetSearchFTSStatement(config config.Config, qrzdt QrzDatatableInput) (searchstmt string, err error) {
if len(qrzdt.Columns) > 0 {
searchstmt = fmt.Sprintf("fts @@ plainto_tsquery('%s')", qrzdt.Search.Value)
} else {

8
src/qrzws/qrzws-packr.go Normal file
View File

@ -0,0 +1,8 @@
// +build !skippackr
// Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT.
// You can use the "packr clean" command to clean up this,
// and any other packr generated files.
package qrzws
import _ "git.paulbsd.com/paulbsd/qrz/packrd"