📦 更新拓展包及框架
This commit is contained in:
@@ -780,12 +780,19 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
// 删除条件
|
||||
$pk = $this->getPk();
|
||||
|
||||
$where = [];
|
||||
if (is_string($pk) && isset($this->data[$pk])) {
|
||||
$where[] = [$pk, '=', $this->data[$pk]];
|
||||
} elseif (!empty($this->updateWhere)) {
|
||||
$where = $this->updateWhere;
|
||||
} else {
|
||||
$where = null;
|
||||
} elseif (is_array($pk)) {
|
||||
foreach ($pk as $field) {
|
||||
if (isset($this->data[$field])) {
|
||||
$where[] = [$field, '=', $this->data[$field]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($where)) {
|
||||
$where = empty($this->updateWhere) ? null : $this->updateWhere;
|
||||
}
|
||||
|
||||
return $where;
|
||||
|
||||
Reference in New Issue
Block a user