关于静态方法调用的问题

浏览:1906 发布日期:2017/12/12 分类:ThinkPHP5专区 关键字: Non-static statically

我在模型里面定义了一个方法,use think\Model;
class User extends Model
{
    static function getTotal($userId){
        $where['user_id']=$userId;
        
        return self::where($where)->count('user_id');
    }
}
这里提示说  Non-static method 'where' should not be called statically看了手册,说这个是5.6.x废弃的特性,除了修改报错等级之外,还有啥修改办法? 看了下代码。where方法是非static.
最佳答案
评论( 相关
后面还有条评论,点击查看>>