截流自动化的商城平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

StoreLValidate.php 4.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\admin\validate\shop;
  20. use app\common\basics\Validate;
  21. class StoreLValidate extends Validate
  22. {
  23. protected $rule = [
  24. 'id' => 'require|number',
  25. 'cid' => 'require|number',
  26. 'type' => 'require|in:1,2',
  27. 'name' => 'require',
  28. 'nickname' => 'require',
  29. 'mobile' => 'require|mobile',
  30. 'account' => 'require|unique:ShopAdmin',
  31. 'password' => 'require|min:6',
  32. 'okPassword' => 'require|min:6|confirm:password',
  33. 'logo' => 'require',
  34. 'trade_service_fee' => 'require|float',
  35. 'weight' => 'require|number',
  36. 'is_run' => 'require|in:0,1',
  37. 'is_freeze' => 'require|in:0,1',
  38. 'is_product_audit' => 'require|in:0,1',
  39. 'is_recommend' => 'require',
  40. 'is_distribution' => 'require',
  41. 'is_pay' => 'require',
  42. 'expire_time' => 'require',
  43. 'delivery_type' => 'require'
  44. ];
  45. protected $message = [
  46. 'id.require' => 'id不可为空',
  47. 'id.number' => 'id必须为数字',
  48. 'type.require' => '请选择商家类型',
  49. 'type.in' => '选择的商家类型不符合',
  50. 'name.require' => '请填写商家名称',
  51. 'nickname.require' => '请填写联系人',
  52. 'mobile.require' => '请填写联系手机号',
  53. 'logo.require' => '请选择商家logo',
  54. 'expire_time.require' => '请选择到期时间',
  55. 'trade_service_fee.require' => '请填写交易服务费率',
  56. 'is_product_audit.require' => '请选择产品是否需要审核',
  57. 'is_run.require' => '请选择店铺营业状态',
  58. 'is_freeze.require' => '请选择商家状态',
  59. 'account.require' => '请填写商家账号',
  60. 'account.unique' => '商家账号不可重复',
  61. 'password.require' => '请填写登录密码',
  62. 'password.min' => '登录密码最少6位数',
  63. 'okPassword.require' => '请填写确认登录密码',
  64. 'okPassword.confirm' => '两次密码不一致',
  65. 'weight.require' => '权重不可为空',
  66. 'weight.number' => '权重必须为数字',
  67. 'is_recommend.require' => '请选择是否推荐商家',
  68. 'is_distribution.require' => '请选择是否允许分销',
  69. 'is_pay.require' => '请选择是否开启支付功能',
  70. 'delivery_type.require' => '最少选择一种配送方式',
  71. ];
  72. protected $scene = [
  73. 'id' => ['id'],
  74. 'add' => ['cid', 'type', 'delivery_type', 'name', 'nickname', 'mobile', 'account', 'password', 'okPassword', 'logo', 'trade_service_fee', 'is_run', 'is_freeze', 'is_product_audit', 'expire_time'],
  75. 'edit' => ['id', 'cid', 'type', 'name', 'delivery_type', 'nickname', 'mobile', 'logo', 'trade_service_fee', 'is_run', 'is_freeze', 'is_product_audit', 'expire_time'],
  76. 'set' => ['id', 'is_recommend', 'weight', 'is_distribution', 'is_pay'],
  77. 'account' => ['id'],
  78. 'pwd' => ['password', 'okPassword']
  79. ];
  80. }