feat: 添加工作流

This commit is contained in:
kuaifan
2022-01-08 16:51:51 +08:00
parent 8a2571f514
commit bbd394272f
17 changed files with 1330 additions and 3 deletions

View File

@@ -140,7 +140,11 @@ class AbstractModel extends Model
$row = static::where($where)->first();
if (empty($row)) {
$row = new static;
$row->updateInstance(array_merge($where, $insert ?: $update));
$array = array_merge($where, $insert ?: $update);
if (isset($array[$row->primaryKey])) {
unset($array[$row->primaryKey]);
}
$row->updateInstance($array);
} elseif ($update) {
$row->updateInstance($update);
}