coupon/work_order_create_validatio...

18 lines
1.3 KiB
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.

# 发起工单页面校验条件
文件:`work_order_create.php`
| # | 校验项 | 校验方式 | 错误提示 |
|---|--------|----------|----------|
| 1 | CSRF Token | `verifyCsrf()` 验证 | 直接 `die('CSRF token无效')` |
| 2 | 工单内容 | `trim($_POST['content'])` 非空 | 工单内容不能为空 |
| 3 | 关联兑换码至少一个 | `array_filter` 去除空白后非空 | 请至少关联一个兑换码 |
| 4 | 兑换码数量 ≤ 10 | `count($codes) > 10` | 最多关联10个兑换码 |
| 5 | 兑换码不重复 | `array_unique` 对比长度 | 关联的兑换码不能重复 |
| 6 | 兑换码属于当前用户 | 查询 `claim_records` 匹配 `user_id``code` | 以下兑换码不在您的领取记录中 |
| 7 | 兑换码未过期 | `status !== 3` | 以下兑换码已过期,无法提交工单 |
| 8 | 兑换码不在未处理工单中 | 查询 `work_orders``creator_id` + `status='未处理'` | 以下兑换码已在未处理的工单中,请处理后再提交 |
| 9 | 附件扩展名 | `pathinfo` 白名单jpg/jpeg/png/gif/pdf/doc/docx/xls/xlsx/zip/rar/txt | 不支持的文件格式 |
| 10 | 附件大小 | `$_FILES['size']` ≤ 10MB | 文件大小不能超过10MB |
| 11 | 附件 MIME 类型 | `finfo` 白名单验证 | 不支持的文件格式 |