同一model下save不能多次新增数据问题

浏览:1253 发布日期:2016/06/23
5.0.0 - 致命 - 未处理
5.0RC3中,先使用save保存了单条数据,然后再save或者saveAll保存其他数据时会把id也传过去了,并且走的是更新数据而不是插入数据,导致程序无法新增数据

已解决
Model.php 中行621附近 $result = $this->db()->insert($this->data, $replace);修正为 $result = $this->db()->insert($data, $replace);

行544附近 if (!empty($where)) {
$this->isUpdate = true;
}
改为 if (!empty($where)) {
$this->isUpdate = true;
}else{
$this->isUpdate = false;
}
评论()
后面还有条评论,点击查看>>