改名
This commit is contained in:
@@ -234,9 +234,9 @@ class ActiveRecord extends BaseActiveRecord
|
|||||||
$primary = $this->getPrimary();
|
$primary = $this->getPrimary();
|
||||||
|
|
||||||
if (!empty($primary)) {
|
if (!empty($primary)) {
|
||||||
$sul = static::deleteAll([$primary => $this->getAttribute($primary)]);
|
$sul = static::deleteByCondition([$primary => $this->getAttribute($primary)]);
|
||||||
} else {
|
} else {
|
||||||
$sul = static::deleteAll($conditions);
|
$sul = static::deleteByCondition($conditions);
|
||||||
}
|
}
|
||||||
if (!$sul) {
|
if (!$sul) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
|||||||
* @return null|string
|
* @return null|string
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getPrimary()
|
public function getPrimary(): ?string
|
||||||
{
|
{
|
||||||
if (!$this->hasPrimary()) {
|
if (!$this->hasPrimary()) {
|
||||||
return null;
|
return null;
|
||||||
@@ -253,7 +253,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function delete($condition = NULL, $attributes = [], $if_condition_is_null = false): bool
|
public static function deleteByCondition($condition = NULL, $attributes = [], $if_condition_is_null = false): bool
|
||||||
{
|
{
|
||||||
if (empty($condition)) {
|
if (empty($condition)) {
|
||||||
if (!$if_condition_is_null) {
|
if (!$if_condition_is_null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user