修改 Model类的saveall方法 返回值

This commit is contained in:
thinkphp
2016-06-21 13:49:02 +08:00
parent 4908633e05
commit 92b3fb7006
2 changed files with 8 additions and 13 deletions

View File

@@ -631,16 +631,16 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* 保存多个数据到当前数据对象
* @access public
* @param array $data 数据
* @return integer
* @return array|false
*/
public function saveAll($dataSet)
{
$result = 0;
$result = [];
$db = $this->db();
$db->startTrans();
try {
foreach ($dataSet as $data) {
$result = $this->isUpdate(false)->save($data, [], false);
$result[] = $this->isUpdate(false)->save($data, [], true);
}
$db->commit();
return $result;