|
@@ -1,6 +1,7 @@
|
|
|
package utils
|
|
package utils
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "errors"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
|
|
|
"github.com/xormplus/xorm"
|
|
"github.com/xormplus/xorm"
|
|
@@ -27,6 +28,12 @@ func PageSearch(engine *xorm.Engine, controllername string, apiname string, tabl
|
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 无数据
|
|
|
|
|
+ if result == nil {
|
|
|
|
|
+ return nil, errors.New("no find rows")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
records := cresult[0]["records"].(int64)
|
|
records := cresult[0]["records"].(int64)
|
|
|
|
|
|
|
|
var totalPageSize int64 = 0
|
|
var totalPageSize int64 = 0
|