feat: 新增员工管理端 CRUD 并增强订单筛选
- /employee 管理端列表/新增/更新/启停用,/employee/me 供管理端判定陪诊员身份 - 订单列表补充支付状态、支付渠道、日期区间、关键词筛选与各页签计数 - 陪诊员订单复用统一列表查询,过滤与分页口径与管理员一致 - 管理员代客下单时订单归属以就诊人档案用户为准,无归属订单跳过未完成上限 - 管理员判定兼容 web-escort-admin 与重构后的 apps 成员视图
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import mongoose from "mongoose";
|
||||
import { DBModel } from "../models/index.js";
|
||||
import ResponseUtil from "../utils/responseUtil.js";
|
||||
|
||||
@@ -51,6 +52,15 @@ class HandlerHealthProfile {
|
||||
if (weight !== undefined && (Number(weight) < 0 || Number(weight) > 500)) {
|
||||
return "体重需在 0-500kg 之间";
|
||||
}
|
||||
|
||||
// 归属用户:管理端代客建档时传入,必须是合法 ObjectId。
|
||||
// 空串/不传表示未绑定(历史数据),C 端 /mine 系列不走这里,其 userId 取自 token
|
||||
if (body.userId !== undefined && body.userId !== null && body.userId !== "") {
|
||||
if (!mongoose.Types.ObjectId.isValid(body.userId)) {
|
||||
return "归属用户ID不合法";
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user