Browse Source

Squashed commit of the following:

commit 3d5ab001f67432c309f7265f12903c3bcacc1c6e
Author: xormplus <xormplus@163.com>
Date:   Fri Nov 18 11:45:06 2016 +0800

    修正session调用SqlTemplateClient函数错误

    修正session调用SqlTemplateClient函数错误

commit c0b462717060e2c61822ae3c6e5c82a4066a859c
Author: xormplus <xormplus@163.com>
Date:   Fri Nov 18 11:43:30 2016 +0800

    修正session调用SqlTemplateClient函数错误

    修正session调用SqlTemplateClient函数错误
WhiteBatman 9 years ago
parent
commit
62622f999a
3 changed files with 4 additions and 0 deletions
  1. 1 0
      engineplus.go
  2. 1 0
      session.go
  3. 2 0
      sessionplus.go

+ 1 - 0
engineplus.go

@@ -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 {

+ 1 - 0
session.go

@@ -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
 }

+ 2 - 0
sessionplus.go

@@ -19,6 +19,7 @@ import (
 
 	"github.com/Chronokeeper/anyxml"
 	"github.com/xormplus/core"
+	"gopkg.in/flosch/pongo2.v3"
 )
 
 type ResultBean struct {
@@ -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("")