mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +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);
|
self::addInitialized(static::class, $objId, $obj);
|
||||||
|
|
||||||
if (empty($objId)) {
|
|
||||||
$update = false;
|
|
||||||
self::create($obj, $relations);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($relations === RelationType::ALL) {
|
if ($relations === RelationType::ALL) {
|
||||||
self::updateHasMany($refClass, $obj, $objId, --$depth);
|
self::updateHasMany($refClass, $obj, $objId, --$depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($update) {
|
if (empty($objId)) {
|
||||||
self::updateModel($obj, $objId, $refClass, --$depth);
|
return self::create($obj, $relations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self::updateModel($obj, $objId, $refClass, --$depth);
|
||||||
|
|
||||||
return $objId;
|
return $objId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -316,6 +316,8 @@ class Grammar extends GrammarAbstract
|
||||||
return \rtrim(\rtrim(\number_format($value, 5, '.', ''), '0'), '.');
|
return \rtrim(\rtrim(\number_format($value, 5, '.', ''), '0'), '.');
|
||||||
} elseif ($value instanceof Column) {
|
} elseif ($value instanceof Column) {
|
||||||
return $this->compileSystem($value->getColumn(), $prefix);
|
return $this->compileSystem($value->getColumn(), $prefix);
|
||||||
|
} elseif ($value instanceof Builder) {
|
||||||
|
return '(' . \rtrim($value->toSql(), ';') . ')';
|
||||||
} else {
|
} else {
|
||||||
throw new \InvalidArgumentException(\gettype($value));
|
throw new \InvalidArgumentException(\gettype($value));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user