mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 12:17:53 +08:00
infract internal link
This commit is contained in:
parent
406b6bf410
commit
6d81aa4462
@ -23,6 +23,7 @@ import (
|
||||
"github.com/gogf/gf/util/gconv"
|
||||
)
|
||||
|
||||
// GetCore returns the underlying *Core object.
|
||||
func (c *Core) GetCore() *Core {
|
||||
return c
|
||||
}
|
||||
@ -122,12 +123,6 @@ func (c *Core) GetAll(sql string, args ...interface{}) (Result, error) {
|
||||
|
||||
// DoGetAll queries and returns data records from database.
|
||||
func (c *Core) DoGetAll(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, err error) {
|
||||
if link == nil {
|
||||
link, err = c.SlaveLink()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
rows, err := c.DoQuery(ctx, link, sql, args...)
|
||||
if err != nil || rows == nil {
|
||||
return nil, err
|
||||
|
@ -24,18 +24,7 @@ import (
|
||||
//
|
||||
// Also see DriverMysql.TableFields.
|
||||
func (m *Model) TableFields(table string, schema ...string) (fields map[string]*TableField, err error) {
|
||||
var (
|
||||
link Link
|
||||
)
|
||||
if m.tx != nil {
|
||||
link = &txLink{m.tx.tx}
|
||||
} else {
|
||||
link, err = m.db.GetCore().SlaveLink(schema...)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
return m.db.TableFields(m.GetCtx(), link, table, schema...)
|
||||
return m.db.TableFields(m.GetCtx(), m.getLink(false), table, schema...)
|
||||
}
|
||||
|
||||
// getModel creates and returns a cloned model of current model if `safe` is true, or else it returns
|
||||
|
Loading…
Reference in New Issue
Block a user