Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Commit b1638ec

Browse files
committed
修正insertall方法的参数绑定
1 parent 8d8e002 commit b1638ec

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

ThinkPHP/Library/Think/Db/Driver.class.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ protected function parseSet($data)
417417
$set[] = $this->parseKey($key) . '=' . $val;
418418
} else {
419419
$name = count($this->bind);
420-
$set[] = $this->parseKey($key) . '=:' . $key . '_' . $name;
421-
$this->bindParam($key . '_' . $name, $val);
420+
$set[] = $this->parseKey($key) . '=:' . 'bind_' . $name;
421+
$this->bindParam('bind_' . $name, $val);
422422
}
423423
}
424424
}
@@ -911,8 +911,8 @@ public function insert($data, $options = array(), $replace = false)
911911
$values[] = $val;
912912
} else {
913913
$name = count($this->bind);
914-
$values[] = ':' . $key . '_' . $name;
915-
$this->bindParam($key . '_' . $name, $val);
914+
$values[] = ':' . 'bind_' . $name;
915+
$this->bindParam('bind_' . $name, $val);
916916
}
917917
}
918918
}
@@ -950,11 +950,11 @@ public function insertAll($dataSet, $options = array(), $replace = false)
950950
$value[] = 'NULL';
951951
} elseif (is_scalar($val)) {
952952
if (0 === strpos($val, ':') && in_array($val, array_keys($this->bind))) {
953-
$value[] = $this->parseValue($val);
953+
$value[] = $val;
954954
} else {
955955
$name = count($this->bind);
956-
$value[] = ':' . $name;
957-
$this->bindParam($name, $val);
956+
$value[] = ':' . 'bind_' . $name;
957+
$this->bindParam('bind_' . $name, $val);
958958
}
959959
}
960960
}

0 commit comments

Comments
 (0)