fix(timetask): 修复历史记录更新后的成功响应位置

- 将成功响应移动到数据库更新操作之后
- 确保在捕获异常之前返回正确的成功状态
- 避免在错误处理分支中执行成功响应逻辑
This commit is contained in:
2026-04-22 00:21:18 +08:00
parent 61e748e020
commit bf469e33ee
+2 -1
View File
@@ -37,12 +37,13 @@ class Index extends Api
Db::name('history')->where('expect', $item['expect'])->update($insert_data); Db::name('history')->where('expect', $item['expect'])->update($insert_data);
} }
} }
$this->success('获取成功');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
$this->success('获取成功');
} else { } else {
$this->error('获取失败'); $this->error('获取失败');
} }