diff --git a/src/Base/Model.php b/src/Base/Model.php index 13881eb..5adae12 100644 --- a/src/Base/Model.php +++ b/src/Base/Model.php @@ -541,7 +541,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T [$sql, $param] = SqlBuilder::builder(static::query())->insert($param); $dbConnection = $this->getConnection()->createCommand($sql, $param); if (!($lastId = $dbConnection->save(true, $this->getAutoIncrement()))) { - var_dump($lastId); + var_dump($lastId, $this->getLastError()); throw new Exception('保存失败.'); } $lastId = $this->setPrimary((int)$lastId, $param); diff --git a/src/Command.php b/src/Command.php index 98f700e..5082537 100644 --- a/src/Command.php +++ b/src/Command.php @@ -169,7 +169,6 @@ class Command extends Component $pdo = $this->db->getConnect($this->sql); $result = $pdo->execute($this->sql, $isInsert, $this->params); if ($hasAutoIncrement && $result == 0) { - var_dump($hasAutoIncrement, $result); return false; } return $result;