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