改名
This commit is contained in:
@@ -385,8 +385,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
|||||||
$this->afterSave($attributes, $param);
|
$this->afterSave($attributes, $param);
|
||||||
$lastId = $this->refresh();
|
$lastId = $this->refresh();
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$lastId = false;
|
|
||||||
$trance->rollback();
|
$trance->rollback();
|
||||||
|
$lastId = $this->addError($exception->getMessage(),'mysql');
|
||||||
}
|
}
|
||||||
return $lastId;
|
return $lastId;
|
||||||
}
|
}
|
||||||
@@ -411,7 +411,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
|||||||
$trance = $command->beginTransaction();
|
$trance = $command->beginTransaction();
|
||||||
if (!($command = $command->createCommand($sql, $param)->save(false, $this->hasAutoIncrement()))) {
|
if (!($command = $command->createCommand($sql, $param)->save(false, $this->hasAutoIncrement()))) {
|
||||||
$trance->rollback();
|
$trance->rollback();
|
||||||
$result = $this->addError($this->getLastError());
|
$result = false;
|
||||||
} else {
|
} else {
|
||||||
$trance->commit();
|
$trance->commit();
|
||||||
$result = $this->refresh();
|
$result = $this->refresh();
|
||||||
|
|||||||
Reference in New Issue
Block a user