Browse Source

Merge branch 'commercialized'

Roc 1 year ago
parent
commit
66246c2015
4 changed files with 5 additions and 10 deletions
  1. 0 2
      go.mod
  2. 0 1
      go.sum
  3. 3 4
      models/table.go
  4. 2 3
      models/table_data.go

+ 0 - 2
go.mod

@@ -17,8 +17,6 @@ require (
 
 require (
 	github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211218165449-dd623ecc2f02 // indirect
-	//github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
-	github.com/astaxie/beego v1.12.3 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
 	github.com/garyburd/redigo v1.6.3 // indirect

+ 0 - 1
go.sum

@@ -8,7 +8,6 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn
 github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
 github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211218165449-dd623ecc2f02 h1:o2oaBQGTzO+xNh12e7xWkphNe7H2DTiWv1ml9a2P9PQ=
 github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211218165449-dd623ecc2f02/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
-github.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ=
 github.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA=
 github.com/beego/bee/v2 v2.0.5 h1:qjzLwKmQo3jNczdA6f2TtXenAimCGBH/aofJnHPJS3w=
 github.com/beego/bee/v2 v2.0.5/go.mod h1:wq0YrEmPcdNfDNpaUgiTkaW9zso7M8n0HCCShEBOzM0=

+ 3 - 4
models/table.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -24,8 +24,7 @@ type TableInfo struct {
 
 // GetTableInfoByUniqueCode 根据union_code 获取表格信息
 func GetTableInfoByUniqueCode(uniqueCode string) (item *TableInfo, err error) {
-	o := orm.NewOrm()
-	o.Using("data")
+	o := orm.NewOrmUsingDB("data")
 	sql := ` SELECT * FROM table_info WHERE unique_code=? `
 	err = o.Raw(sql, uniqueCode).QueryRow(&item)
 	return
@@ -33,6 +32,6 @@ func GetTableInfoByUniqueCode(uniqueCode string) (item *TableInfo, err error) {
 
 // TableInfoDetailResp 表格详情返回
 type TableInfoDetailResp struct {
-	TableInfo   *TableInfo
+	TableInfo     *TableInfo
 	TableDataList []*TableData
 }

+ 2 - 3
models/table_data.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -29,8 +29,7 @@ type TableData struct {
 
 // GetTableDataListByTableInfoId 根据表格id获取数据列表
 func GetTableDataListByTableInfoId(tableInfoId int) (items []*TableData, err error) {
-	o := orm.NewOrm()
-	o.Using("data")
+	o := orm.NewOrmUsingDB("data")
 	pars := make([]interface{}, 0)
 	pars = append(pars, tableInfoId)