From a3a9350c6f18ae54111f088c9221d817cc8770e5 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 30 Jul 2022 20:35:41 +0800 Subject: [PATCH 1/5] Update go.mod --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 28fc3a3eb..0c751c357 100644 --- a/go.mod +++ b/go.mod @@ -28,3 +28,5 @@ require ( gopkg.in/yaml.v2 v2.2.8 xorm.io/xorm v1.0.2 ) + +replace github.com/GoAdminGroup/go-admin => github.com/zoulux/go-admin From 0ae37589f50c8e8c2d7c419de17075315153c164 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 30 Jul 2022 20:44:13 +0800 Subject: [PATCH 2/5] Update default.go --- plugins/admin/modules/table/default.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/admin/modules/table/default.go b/plugins/admin/modules/table/default.go index 685307fdc..b7947f45b 100644 --- a/plugins/admin/modules/table/default.go +++ b/plugins/admin/modules/table/default.go @@ -1123,6 +1123,12 @@ func (tb *DefaultTable) sql() *db.SQL { return db.WithDriverAndConnection(tb.connection, tb.db()) } +// sql is a helper function return db sql. +func (tb *DefaultTable) GetSql() *db.SQL { + return tb.sql() +} + + // sqlObjOrNil is a helper function return db sql obj or nil. func (tb *DefaultTable) sqlObjOrNil() *db.SQL { if tb.connectionDriver != "" && tb.getDataFromDB() { From 7123e36798375eb319313e4457773a539d7ce9b4 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 30 Jul 2022 20:45:01 +0800 Subject: [PATCH 3/5] Update table.go --- plugins/admin/modules/table/table.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/admin/modules/table/table.go b/plugins/admin/modules/table/table.go index 48784fed6..e1c4da439 100644 --- a/plugins/admin/modules/table/table.go +++ b/plugins/admin/modules/table/table.go @@ -72,6 +72,9 @@ type Table interface { GetOnlyUpdateForm() bool Copy() Table + + GetSql() *db.SQL + } type BaseTable struct { From 81d2cbe3837a17efeb70756e5aa3ced8073a7eb7 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 30 Jul 2022 20:53:45 +0800 Subject: [PATCH 4/5] Update go.mod --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 0c751c357..8970aabe2 100644 --- a/go.mod +++ b/go.mod @@ -29,4 +29,3 @@ require ( xorm.io/xorm v1.0.2 ) -replace github.com/GoAdminGroup/go-admin => github.com/zoulux/go-admin From 89489904dc0b2c675f3cdd0865e7faee16f1f2e6 Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 8 Feb 2023 23:37:15 +0800 Subject: [PATCH 5/5] fix: mysql/driver@1.7 "INT" return "UNSIGNED INT" --- modules/db/converter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/db/converter.go b/modules/db/converter.go index 1eb5c7588..8965f79bd 100644 --- a/modules/db/converter.go +++ b/modules/db/converter.go @@ -6,6 +6,7 @@ package db import ( "database/sql" + "strings" ) // SetColVarType set the column type. @@ -35,6 +36,8 @@ func SetColVarType(colVar *[]interface{}, i int, typeName string) { // SetResultValue set the result value. func SetResultValue(result *map[string]interface{}, index string, colVar interface{}, typeName string) { + arr := strings.Split(typeName, " ") + typeName = arr[len(arr)-1] dt := DT(typeName) switch { case Contains(dt, BoolTypeList):