Ver Fonte

修改工具类

renzheng há 9 anos atrás
pai
commit
833ce88668
2 ficheiros alterados com 7 adições e 2 exclusões
  1. 4 0
      common/src/gopkg.in/mgo.v2/session.go
  2. 3 2
      common/src/qfw/util/common.go

+ 4 - 0
common/src/gopkg.in/mgo.v2/session.go

@@ -1975,6 +1975,10 @@ func (c *Collection) Pipe(pipeline interface{}) *Pipe {
 
 // Iter executes the pipeline and returns an iterator capable of going
 // over all the generated results.
+func (p *Pipe) SetAllowDisk(b bool) *Pipe {
+	p.allowDisk = b
+	return p
+}
 func (p *Pipe) Iter() *Iter {
 	// Clone session and set it to Monotonic mode so that the server
 	// used for the query may be safely obtained afterwards, if

+ 3 - 2
common/src/qfw/util/common.go

@@ -193,8 +193,9 @@ func Int64All(num interface{}) int64 {
 	} else if i3, ok3 := num.(float32); ok3 {
 		return int64(i3)
 	} else if i4, ok4 := num.(string); ok4 {
-		in, _ := strconv.Atoi(i4)
-		return int64(in)
+		i64, _ := strconv.ParseInt(i4, 10, 0)
+		//in, _ := strconv.Atoi(i4)
+		return i64
 	} else if i5, ok5 := num.(int16); ok5 {
 		return int64(i5)
 	} else if i6, ok6 := num.(int8); ok6 {