mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-18 04:48:39 +00:00
Fix bugs
This commit is contained in:
parent
857970c230
commit
4ed4caf55b
|
|
@ -1386,19 +1386,16 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
|
||||
self::addInitialized(static::class, $objId, $obj);
|
||||
|
||||
if (empty($objId)) {
|
||||
$update = false;
|
||||
self::create($obj, $relations);
|
||||
}
|
||||
|
||||
if ($relations === RelationType::ALL) {
|
||||
self::updateHasMany($refClass, $obj, $objId, --$depth);
|
||||
}
|
||||
|
||||
if ($update) {
|
||||
self::updateModel($obj, $objId, $refClass, --$depth);
|
||||
if (empty($objId)) {
|
||||
return self::create($obj, $relations);
|
||||
}
|
||||
|
||||
self::updateModel($obj, $objId, $refClass, --$depth);
|
||||
|
||||
return $objId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -316,6 +316,8 @@ class Grammar extends GrammarAbstract
|
|||
return \rtrim(\rtrim(\number_format($value, 5, '.', ''), '0'), '.');
|
||||
} elseif ($value instanceof Column) {
|
||||
return $this->compileSystem($value->getColumn(), $prefix);
|
||||
} elseif ($value instanceof Builder) {
|
||||
return '(' . \rtrim($value->toSql(), ';') . ')';
|
||||
} else {
|
||||
throw new \InvalidArgumentException(\gettype($value));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user