validate_rules.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. return [
  3. //通用-关键字
  4. 'keyword' => [
  5. 'keyword|关键字' => 'chsDash|max:100',
  6. ],
  7. //通用
  8. 'common' => [
  9. 'keyword|关键字' => 'chsDash|max:100',
  10. 'page|页码' => 'require|number|gt:0',
  11. 'size|每页数量' => 'require|number|elt:100',
  12. ],
  13. //登录
  14. 'login' => [
  15. 'mobile|手机号' => 'require|number|length:11|mobile',
  16. 'password|密码' => 'require',
  17. ],
  18. //修改密码
  19. 'changePassword' => [
  20. 'old_password|旧密码' => 'require|min:6|max:200',
  21. 'new_password|新密码' => 'require|min:6|max:200',
  22. 'confirm_password|确认密码' => 'require|confirm:new_password|min:6|max:200',
  23. ],
  24. //添加供应商账号
  25. 'addAccount' => [
  26. 'nickname|姓名' => 'require|max:255',
  27. 'mobile|手机号' => 'require|number|length:11|mobile',
  28. 'email|邮箱' => 'email',
  29. ],
  30. //修改供应商账号
  31. 'editAccount' => [
  32. 'nickname|姓名' => 'require|max:255',
  33. 'mobile|手机号' => 'require|number|length:11|mobile',
  34. 'email|邮箱' => 'email',
  35. 'old_mobile|原始手机号' => 'require|number|length:11|mobile',
  36. ],
  37. //启/禁用 供应商账号
  38. 'statusAccount' => [
  39. 'mobile|手机号' => 'require|number|length:11|mobile',
  40. 'status|状态' => 'require|number|in:' . \app\abutment\model\SupplierUser::$status_normal . ',' . \app\abutment\model\SupplierUser::$status_disabled,
  41. ],
  42. //获取分类列表
  43. 'getCatList' => [
  44. 'keyword|关键字' => 'chsDash|max:100',
  45. 'pid|父级分类id' => 'require|number|egt:0',
  46. ],
  47. //获取规格值列表
  48. 'getSpecsValueByTitleList' => [
  49. 'spec_id|规格类型id' => 'require|number|gt:0',
  50. ],
  51. //获取省市县列表
  52. 'getAreaList' => [
  53. 'level' => 'number|in:1,2,3',
  54. 'pid_code' => 'requireIf:level,2|requireIf:level,3|number|length:6',
  55. ],
  56. //创建商品上线申请
  57. 'GoodUpCreate' => [
  58. 'spuCodes|商品编码' => 'require|array|max:10',
  59. 'online_reason|上线原因' => 'require|max:255',
  60. 'online_remark|上线备注' => 'require|max:255',
  61. 'platform_id|平台id' => 'require|number|gt:0',
  62. ],
  63. ];