新增数据method not exist:think\db\Query->saveAll

问题遇到的现象和发生背景

批量新增

遇到的现象和发生背景,请写出第一个错误信息

method not exist:think\db\Query->saveAll

用代码块功能插入代码,请勿粘贴截图。 不用代码块回答率下降 50%
$res = Db::name('invoice_rate')->saveAll();//在model里面使用saveAll

//这是报错
[0] Exception in Query.php line 200
method not exist:think\db\Query->saveAll
            return call_user_func_array([$this, 'where'], $args);
        } elseif ($this->model && method_exists($this->model, 'scope' . $method)) {
            // 动态调用命名范围
            $method = 'scope' . $method;
            array_unshift($args, $this);

            call_user_func_array([$this->model, $method], $args);
            return $this;
        } else {
            throw new Exception('method not exist:' . ($this->model ? get_class($this->model) : static::class) . '->' . $method);
        }
    }

    /**
     * 扩展查询方法
     * @access public
     * @param  string|array  $method     查询方法名
     * @param  callable      $callback
     * @return void


运行结果及详细报错内容
[0] Exception in Query.php line 200
method not exist:think\db\Query->saveAll
            return call_user_func_array([$this, 'where'], $args);
        } elseif ($this->model && method_exists($this->model, 'scope' . $method)) {
            // 动态调用命名范围
            $method = 'scope' . $method;
            array_unshift($args, $this);

            call_user_func_array([$this->model, $method], $args);
            return $this;
        } else {
            throw new Exception('method not exist:' . ($this->model ? get_class($this->model) : static::class) . '->' . $method);
        }
    }

    /**
     * 扩展查询方法
     * @access public
     * @param  string|array  $method     查询方法名
     * @param  callable      $callback
     * @return void


我的解答思路和尝试过的方法,不写自己思路的,回答率下降 60%

在当前问题上面进行了一系列的测试,save isupdate saveall等等都是会报类似的错误

我想要达到的结果,如果你需要快速回答,请尝试 “付费悬赏”

单独针对这一行代码而言
$res = Db::name('invoice_rate')->saveAll();

你看看saveAll()里面是不是要传递参数,又或者不能操作?

一版 DB::name(‘xxx’) 返回的是一个数据库对象,保存的时候不知道是不是更新,如果是更新的话,应该有个查询条件

ps:看看tp的手册 数据库模块