From 396b0b8f86806a86383859ab8b3f77c4d9307cb6 Mon Sep 17 00:00:00 2001 From: zhenghaorong Date: Wed, 13 Sep 2023 10:42:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=9F=E6=88=90=E8=A1=A8?= =?UTF-8?q?=E5=90=8D=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chain.go | 6 ++++++ transaction_chain.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/chain.go b/chain.go index 27153be..66f99dc 100644 --- a/chain.go +++ b/chain.go @@ -197,6 +197,7 @@ func (this *Query) Clean() *Query { this.save_data = this.save_data[0:0] this.upd_field = this.upd_field[0:0] this.having = "" + this.alias = "" return this } @@ -266,6 +267,11 @@ func (this *Query) GetTableInfo(table string) (map[string]interface{}, error) { }, nil } +// 返回表名 +func (this *Query) GetTableName(table string) string { + return getTableName(this.dbname, table) +} + // 构造子查询 func (this *Query) BuildSelectSql() (map[string]interface{}, error) { if this.dbname == "" && this.table == "" { diff --git a/transaction_chain.go b/transaction_chain.go index 2cc5f2d..11d273a 100644 --- a/transaction_chain.go +++ b/transaction_chain.go @@ -197,9 +197,15 @@ func (this *TxQuery) Clean() *TxQuery { this.save_data = this.save_data[0:0] this.upd_field = this.upd_field[0:0] this.having = "" + this.alias = "" return this } +// 返回表名 +func (this *TxQuery) GetTableName(table string) string { + return getTableName(this.dbname, table) +} + // 构造子查询 func (this *TxQuery) BuildSelectSql() (map[string]interface{}, error) { if this.dbname == "" && this.table == "" {