出报告 3 小时后才允许用户查看体检报告。

main
岩仔88 1 month ago
parent 4c2bd7e000
commit ea82c24ecc

@ -600,6 +600,15 @@ public function list(Request $request)
])['data']; ])['data'];
$list = []; $list = [];
foreach ($res as $item) { foreach ($res as $item) {
if (($item['体检状态'] ?? '') !== '报告已出') {
continue;
}
$reportDate = $item['报告日期'] ?? null;
if ($reportDate) {
if (time() < strtotime($reportDate) + 3 * 60 * 60) {
continue;
}
}
$list[] = [ $list[] = [
'id' => $item['体检号'], 'id' => $item['体检号'],
'title' => explode('T', $item['登记时间'])[0] . ' 体检报告', 'title' => explode('T', $item['登记时间'])[0] . ' 体检报告',

@ -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()` 等其他后端方法

@ -1,7 +1,7 @@
let url_ = "https://bjrrtj-api.sixinyun.com"; let url_ = "https://bjrrtj-api.sixinyun.com";
let report_url_ = "https://bjrrtj-api.sixinyun.com"; let report_url_ = "https://bjrrtj-api.sixinyun.com";
let h5_url_ = "https://bjrrtj-api.sixinyun.com"; let h5_url_ = "https://bjrrtj-api.sixinyun.com";
const dev = 1; const dev = 0;
if (dev === 1) { if (dev === 1) {
url_ = "http://localbeijingrenren"; url_ = "http://localbeijingrenren";
report_url_ = "http://192.168.31.106:5173"; report_url_ = "http://192.168.31.106:5173";

@ -3,7 +3,7 @@ import {
} from '@/lu/axios.js' } from '@/lu/axios.js'
import $api from './api.js' import $api from './api.js'
let url_ = "https://bjrrtj-api.sixinyun.com"; let url_ = "https://bjrrtj-api.sixinyun.com";
const dev =1 const dev =0
if (dev === 1) { if (dev === 1) {
url_ = "http://localbeijingrenren" url_ = "http://localbeijingrenren"
} }

Loading…
Cancel
Save