Giter Site home page Giter Site logo

Comments (3)

fizzday avatar fizzday commented on May 22, 2024

@cgsunshine 底层驱动在没有数据的时候返回的是0, 你这个nil是在什么情况下出现的, 能否提供一下用法示例呢, 以便彻底排查清楚问题并解决, 谢谢

from gorose.

cgsunshine avatar cgsunshine commented on May 22, 2024

order, err3 := connect.Table("order").Where("memberuuid", uuid).Count()
如果查不到值 就报错 改了之后是这样
// Count : select count rows
func (dba Session) Count(args ...string) (int64, error) {
fields := "
"
if len(args) > 0 {
fields = utils.ParseStr(args[0])
}
count, err := dba.UnionAct("count", fields)
if count == nil {
count = int64(0)
}
return count.(int64), err
}

from gorose.

fizzday avatar fizzday commented on May 22, 2024

@cgsunshine 恩, 我复现了这个错误, 当我把字段名字写错的时候, 就会panic错误, order的值确实为nil, 多谢指出, 这里没有做严谨性判断, 你可以把这段代码提一个 pr , 我合并到主分支, 也算是你参与的一部分

from gorose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.