StoreServiceValidate.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\merchant;
  12. use think\Validate;
  13. class StoreServiceValidate extends Validate
  14. {
  15. protected $failException = true;
  16. protected $rule = [
  17. 'uid|客服' => 'require|array',
  18. 'uid.id|客服' => 'require|integer',
  19. 'nickname|客服名称' => 'require|max:12',
  20. 'avatar|客服头像' => 'max:250',
  21. 'account|客服账号' => 'require|min:5|max:16',
  22. 'pwd|客服密码' => 'require|min:6|max:16',
  23. 'confirm_pwd|确认密码' => 'require|min:6|max:16',
  24. 'is_open|状态' => 'require|in:0,1',
  25. 'status|状态' => 'require|in:0,1',
  26. 'is_verify|核销状态' => 'require|in:0,1',
  27. 'is_goods|商品管理状态' => 'require|in:0,1',
  28. 'notify|订单通知状态' => 'require|in:0,1',
  29. 'sort|排序' => 'require|integer',
  30. 'customer|展示统计管理状态' => 'require|in:0,1',
  31. ];
  32. protected $message = [
  33. 'account.min' => '客服账号长度不能小于5个字符',
  34. 'uid.require' => '请选择一个用户绑定为客服',
  35. 'uid.id.require' => '用户ID不能为空'
  36. ];
  37. public function update()
  38. {
  39. $this->rule['pwd|客服密码'] = 'min:6|max:16';
  40. $this->rule['confirm_pwd|确认密码'] = 'min:6|max:16';
  41. return $this;
  42. }
  43. }