validate_rules.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. use app\model\AdminMenuModel;
  3. use app\model\CommonModel;
  4. use app\model\GroupModel;
  5. use app\model\RoleModel;
  6. use app\model\ThemeModel;
  7. return [
  8. //【通用】
  9. 'common' => [
  10. 'keyword|关键字' => 'chsDash|max:100',
  11. 'page|页码' => 'require|number|gt:0',
  12. 'size|每页数量' => 'require|number|elt:100',
  13. 'status|状态' => 'number|in:' . CommonModel::$status_normal . ',' . CommonModel::$status_disable,
  14. 'company_id|企业' => 'number|gt:0',
  15. 'card_id|卡类型' => 'number|gt:0',
  16. ],
  17. //【启禁用】
  18. 'status' => [
  19. 'id' => 'require|number|gt:0',
  20. 'status|状态' => 'require|number|in:' . CommonModel::$status_normal . ',' . CommonModel::$status_disable,
  21. ],
  22. //【登录】
  23. 'login' => [
  24. 'username|卡号' => 'require|max:255',
  25. 'password|密码' => 'require|max:255',
  26. 'callback_url|登录成功以后要跳转的url' => 'url',
  27. ],
  28. //【地址】
  29. //添加
  30. 'AddrAdd' => [
  31. 'addr_code|收货地址省市区编码' => 'require|array|length:3',
  32. 'addr|详情地址' => 'require|max:255',
  33. 'contactor|联系人' => 'require|max:255',
  34. 'mobile|联系电话' => 'require|mobile',
  35. ],
  36. //修改密码
  37. 'changePassword' => [
  38. 'old_password|旧密码' => 'require|min:6|max:255',
  39. 'new_password|新密码' => 'require|min:6|max:255',
  40. ],
  41. //商品详情
  42. 'goodInfo' => [
  43. 'code|编码' => 'require|length:18'
  44. ],
  45. //【订单】
  46. 'ExchangeOrderAdd' => [
  47. 'good_id|商品' => 'require|number|gt:0',
  48. 'addr_id|收货地址' => 'require|number|gt:0',
  49. 'num|购买数量' => 'require|number|gt:0|lt:999999999',
  50. 'remark|' => 'max:255',
  51. ],
  52. ];