- 路由:从 screen_public 拆出 portal_public(默认 true),关掉大屏不再连带 404; 设置页显示客户自助状态;/customer 与 /screen 各自独立。 - 查询:尾号只接受 4–8 位数字,服务端精确匹配,去掉 LIKE 模糊回退;按 IP 40 次/分钟限流;页面 noindex。 - 语义:修正「今日待完成」把已完成数当待完成数的问题;0/0 改为「今日无排单」; 无订阅走空态;删掉进度条和重复的今日文案,只留一个状态。 - 订阅:复用管理端 SubView / calSub;通行证 1/1、深渊 x/y 周期;过期、暂停、 按次用尽、跳过都有独立口径;「最近到期」只取未来日期。 - 日历:与主日历一致,只在本月格显示任务;通行证/深渊整段色块(深渊按周期 减淡),日常任务用空心/实心点;每格带读屏描述;today 加「今天」文字标记。 - 错误:只渲染一次并放回内容容器,字段加 aria-invalid;删掉顶部重复横幅。 - 多客户:显示掩码姓名 + 卡内补姓名表单;姓名回填;翻月用 url.Values 编码; 1 位尾号不触发查询;只有空态/补姓名时 autofocus。 - UI:品牌头、可折叠「查询其他尾号」、订阅全宽列表、状态统一用现有 chip、 月份按钮 44px、去掉卡中卡 / opacity / 满屏 0/1。 - 版本 1.11.3;README 增加 4.4 与 portal_public 配置说明。 验证:gofmt / go vet / go test 全绿;portal_public=true 时 /customer 200、 false 时 404;screen_public=false + portal_public=true 时 /customer 200、 /screen 302;尾号 2 与 % 被拒;2222 多客户掩码;9900 日常点、3321 通行证 1/1、6677 深渊 1/4 + 已到期订阅;明暗 1440 与 390 截图无对比度/溢出问题。
This commit is contained in:
@@ -236,13 +236,22 @@ func (db *DB) CustomerCount() (int, error) {
|
||||
return n, err
|
||||
}
|
||||
|
||||
// CustomersByTailExact 按手机尾号精确匹配客户(客户自助页用,不退回模糊匹配)。
|
||||
func (db *DB) CustomersByTailExact(tail string) ([]Customer, error) {
|
||||
tail = strings.TrimSpace(tail)
|
||||
if tail == "" {
|
||||
return nil, nil
|
||||
}
|
||||
return db.queryCustomers(`SELECT `+customerCols+` FROM customers WHERE IFNULL(archived,0)=0 AND tail = ? ORDER BY id`, tail)
|
||||
}
|
||||
|
||||
// CustomersByTail 按手机尾号精确匹配客户;没有精确命中时退回模糊匹配。
|
||||
func (db *DB) CustomersByTail(tail string) ([]Customer, error) {
|
||||
tail = strings.TrimSpace(tail)
|
||||
if tail == "" {
|
||||
return nil, nil
|
||||
}
|
||||
out, err := db.queryCustomers(`SELECT `+customerCols+` FROM customers WHERE IFNULL(archived,0)=0 AND tail = ? ORDER BY id`, tail)
|
||||
out, err := db.CustomersByTailExact(tail)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user