mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 20:48:09 +08:00
Update SystemService.php
This commit is contained in:
parent
6fc2d30872
commit
c99c17fa00
@ -191,8 +191,7 @@ class SystemService extends Service
|
|||||||
try {
|
try {
|
||||||
$query = Helper::buildQuery($query)->master()->where($map);
|
$query = Helper::buildQuery($query)->master()->where($map);
|
||||||
if (empty($map[$key])) $query->where([$key => $data[$key] ?? null]);
|
if (empty($map[$key])) $query->where([$key => $data[$key] ?? null]);
|
||||||
$model = (clone $query)->findOrEmpty();
|
return (clone $query)->count() > 1 ? $query->strict(false)->update($data) : $query->findOrEmpty()->save($data);
|
||||||
return $model->isExists() ? (clone $query)->strict(false)->update($data) : $model->save($data);
|
|
||||||
} catch (\Exception|\Throwable $exception) {
|
} catch (\Exception|\Throwable $exception) {
|
||||||
throw new Exception($exception->getMessage(), $exception->getCode());
|
throw new Exception($exception->getMessage(), $exception->getCode());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user