改名
This commit is contained in:
@@ -206,17 +206,9 @@ class ActiveRecord extends BaseActiveRecord
|
|||||||
$primary = $this->getPrimary();
|
$primary = $this->getPrimary();
|
||||||
|
|
||||||
if (!empty($primary)) {
|
if (!empty($primary)) {
|
||||||
$sul = static::deleteByCondition([$primary => $this->getAttribute($primary)]);
|
$conditions = [$primary => $this->getAttribute($primary)];
|
||||||
} else {
|
|
||||||
$sul = static::deleteByCondition($conditions);
|
|
||||||
}
|
}
|
||||||
if (!$sul) {
|
return static::deleteByCondition($conditions);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (method_exists($this, 'afterDelete')) {
|
|
||||||
$this->afterDelete();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user