dy-dashboard/vault/知识库/工作指南/训练记录/2026-06-24-物流时间字段加限制.md
2026-10-28 11:14:17 +08:00

16 lines
862 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2026-06-24 物流时间字段加数值限制
**旭东 → OpenClaw:**
> 产品信息管理里面,我编辑商品的时候,物流时间字段有什么限制吗,我输入很长的数字之后,提示(1264, "Out of range value for column 'logistics_time' at row 1")
**OpenClaw 响应:**
确定为 MySQL `logistics_time` 字段类型为 `int`(最大 2,147,483,647),输入超长数字触发 out of range 报错。
**修复方案(方案A):**
1. **前端新增弹窗**:`#pa_logis` 输入框增加 `max="999"`
2. **前端编辑弹窗**:`logistics_time` 字段定义增加 `max: 999`,HTML 模板增加 `maxAttr` 渲染支持
3. **后端新增产品 API** (`INSERT`):`min(int(value), 999)` 截断
4. **后端批量更新 API** (`batch_update`):`lead_time` / `logistics_time` 字段校验超过 999 返回友好错误提示
已记录