From c23395555d4cbb0c47e37a32dbe8bcc3d1da8302 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 2 Jun 2020 02:21:33 +0200 Subject: [PATCH] fix in qrzws --- src/qrzws/main.go | 20 ++------------------ src/qrzws/qrzws-packr.go | 8 ++++++++ 2 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 src/qrzws/qrzws-packr.go diff --git a/src/qrzws/main.go b/src/qrzws/main.go index 1068de7..4bda06e 100644 --- a/src/qrzws/main.go +++ b/src/qrzws/main.go @@ -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 { diff --git a/src/qrzws/qrzws-packr.go b/src/qrzws/qrzws-packr.go new file mode 100644 index 0000000..85d2128 --- /dev/null +++ b/src/qrzws/qrzws-packr.go @@ -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"