fix: 健康指标接口字段名修复
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user