📦 更新拓展包及框架

This commit is contained in:
WispX
2020-01-08 11:24:11 +08:00
parent 08166e2044
commit 58b5956a15
116 changed files with 1929 additions and 1693 deletions
+11 -4
View File
@@ -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;