fix: 健康指标接口字段名修复

This commit is contained in:
li
2026-03-14 23:14:03 +08:00
parent d104286a37
commit a163ac1766
2 changed files with 6 additions and 3 deletions
@@ -80,10 +80,13 @@ class CareController extends Controller
->where('care_profile_id', $profile->id);
if ($request->filled('metric_type')) {
$query->where('metric_type', $request->input('metric_type'));
$query->where('metric_type', (string) $request->input('metric_type'));
}
$list = $query->orderByDesc('measured_at')->limit(30)->get();
$limit = (int) $request->input('limit', 30);
$limit = max(1, min($limit, 50));
$list = $query->orderByDesc('recorded_at')->limit($limit)->get();
return $this->success($list);
}
+1 -1
View File
@@ -32,7 +32,7 @@ onMounted(async () => {
</div>
<div class="metric-body">
<span class="metric-type">{{ metricTypeLabel[m.metric_type] || '指标' }}</span>
<span class="metric-time">{{ m.measured_at?.slice(0, 16) }}</span>
<span class="metric-time">{{ m.recorded_at?.slice(0, 16) }}</span>
</div>
<span class="metric-val" :style="{ color: typeColor[m.metric_type] }">
{{ m.value }} {{ metricUnit[m.metric_type] || '' }}