diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 8a62714..f48a8ff 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -600,6 +600,15 @@ public function list(Request $request) ])['data']; $list = []; foreach ($res as $item) { + if (($item['体检状态'] ?? '') !== '报告已出') { + continue; + } + $reportDate = $item['报告日期'] ?? null; + if ($reportDate) { + if (time() < strtotime($reportDate) + 3 * 60 * 60) { + continue; + } + } $list[] = [ 'id' => $item['体检号'], 'title' => explode('T', $item['登记时间'])[0] . ' 体检报告', diff --git a/docs/superpowers/specs/2026-06-24-report-3hour-limit-design.md b/docs/superpowers/specs/2026-06-24-report-3hour-limit-design.md new file mode 100644 index 0000000..adc9b00 --- /dev/null +++ b/docs/superpowers/specs/2026-06-24-report-3hour-limit-design.md @@ -0,0 +1,31 @@ +# 体检报告3小时查看限制设计 + +## 需求 + +出报告 3 小时后才允许用户查看体检报告。 + +## 时间依据 + +PEIS 接口 `QueryExamReport` 返回的 `报告日期` 字段为报告生成/完成时间(格式:`2026-05-29T07:03:18`)。 + +## 实现方案 + +仅在后端 `ReportController::list()` 方法中增加过滤逻辑,列表不可见则用户无法访问任何报告相关页面(详情、对比、趋势分析、PDF 下载)。 + +### 改动文件 + +- `app/Http/Controllers/ReportController.php` — `list()` 方法 + +### 过滤条件 + +1. `体检状态` 必须为 `'报告已出'` +2. `报告日期 + 3 小时 ≤ 当前时间`(`time() < strtotime($reportDate) + 10800` 则跳过) +3. `报告日期` 为空的记录不做时间过滤(仅做状态过滤) + +### 不修改范围 + +- 前端(UniApp)代码 +- 路由 +- 数据库 +- 配置 +- `info()`、`contrast()`、`analysis()`、`down_pdf()` 等其他后端方法 diff --git a/北京仁仁体检小程序/api/api.js b/北京仁仁体检小程序/api/api.js index 810c645..c6701b0 100644 --- a/北京仁仁体检小程序/api/api.js +++ b/北京仁仁体检小程序/api/api.js @@ -1,7 +1,7 @@ let url_ = "https://bjrrtj-api.sixinyun.com"; let report_url_ = "https://bjrrtj-api.sixinyun.com"; let h5_url_ = "https://bjrrtj-api.sixinyun.com"; -const dev = 1; +const dev = 0; if (dev === 1) { url_ = "http://localbeijingrenren"; report_url_ = "http://192.168.31.106:5173"; diff --git a/北京仁仁体检小程序/api/index.js b/北京仁仁体检小程序/api/index.js index 8e19466..f90115e 100644 --- a/北京仁仁体检小程序/api/index.js +++ b/北京仁仁体检小程序/api/index.js @@ -3,7 +3,7 @@ import { } from '@/lu/axios.js' import $api from './api.js' let url_ = "https://bjrrtj-api.sixinyun.com"; -const dev =1 +const dev =0 if (dev === 1) { url_ = "http://localbeijingrenren" }