|
@@ -727,7 +727,9 @@ class ItemService extends Service
|
|
|
if (!$cfg) return [false, '无效的类型'];
|
|
if (!$cfg) return [false, '无效的类型'];
|
|
|
|
|
|
|
|
// 2. 统一查询主体对象
|
|
// 2. 统一查询主体对象
|
|
|
- $target = $cfg['model']::where('del_time', 0)->find($id);
|
|
|
|
|
|
|
+ $target = $cfg['model']::where('id', $id)
|
|
|
|
|
+ ->where('del_time', 0)
|
|
|
|
|
+ ->first();
|
|
|
|
|
|
|
|
// 3. 健壮性检查:防止操作不存在的记录
|
|
// 3. 健壮性检查:防止操作不存在的记录
|
|
|
if (!$target) return [false, "未找到该{$cfg['name']}"];
|
|
if (!$target) return [false, "未找到该{$cfg['name']}"];
|