Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 3d5ab00
Author: xormplus <[email protected]>
Date:   Fri Nov 18 11:45:06 2016 +0800

    修正session调用SqlTemplateClient函数错误

    修正session调用SqlTemplateClient函数错误

commit c0b4627
Author: xormplus <[email protected]>
Date:   Fri Nov 18 11:43:30 2016 +0800

    修正session调用SqlTemplateClient函数错误

    修正session调用SqlTemplateClient函数错误
  • Loading branch information
WhiteBatman committed Nov 18, 2016
1 parent 96cf41c commit 62622f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions engineplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func (engine *Engine) SqlTemplateClient(sqlTagName string, args ...interface{})
session.IsAutoClose = true
session.IsSqlFuc = true
return session.SqlTemplateClient(sqlTagName, args...)

}

func (engine *Engine) Search(beans interface{}, condiBeans ...interface{}) *ResultStructs {
Expand Down
1 change: 1 addition & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (session *Session) Sql(query string, args ...interface{}) *Session {
// SQL provides raw sql input parameter. When you have a complex SQL statement
// and cannot use Where, Id, In and etc. Methods to describe, you can use SQL.
func (session *Session) SQL(query interface{}, args ...interface{}) *Session {
session.IsSqlFuc = true
session.Statement.SQL(query, args...)
return session
}
Expand Down
2 changes: 2 additions & 0 deletions sessionplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

"github.com/Chronokeeper/anyxml"
"github.com/xormplus/core"
"gopkg.in/flosch/pongo2.v3"
)

type ResultBean struct {
Expand Down Expand Up @@ -384,6 +385,7 @@ func (session *Session) SqlMapClient(sqlTagName string, args ...interface{}) *Se
}

func (session *Session) SqlTemplateClient(sqlTagName string, args ...interface{}) *Session {
session.IsSqlFuc = true
if session.Engine.sqlTemplate.Template[sqlTagName] == nil {
if len(args) == 0 {
return session.Sql("")
Expand Down

0 comments on commit 62622f9

Please sign in to comment.