SalesmanValidate.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\admin\validate\medical;
  3. use think\Validate;
  4. class SalesmanValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'salesman_id' => 'require',
  8. 'salesman_shop_id' => 'require',
  9. 'salesman_name' => 'require',
  10. 'salesman_pwd' => 'require',
  11. 'again_salesman_pwd' => 'require',
  12. 'salesman_phone' => 'require',
  13. 'salesman_resale_name' => 'require',
  14. 'salesman_status' => 'require',
  15. ];
  16. protected $message = [
  17. 'salesman_id.require' => '业务员ID不能为空',
  18. 'salesman_shop_id.require' => '店铺ID不能为空',
  19. 'salesman_name.require' => '登录名不能为空',
  20. 'salesman_pwd.require' => '密码不能为空',
  21. 'again_salesman_pwd.require' => '确认密码不能为空',
  22. 'salesman_phone.require' => '业务员手机号不能为空',
  23. 'salesman_resale_name.require' => '业务员姓名不能为空',
  24. 'salesman_status.require' => '状态不能为空',
  25. ];
  26. //场景
  27. protected $scene = [
  28. 'create' => [
  29. 'salesman_shop_id','salesman_name','salesman_pwd',
  30. 'again_salesman_pwd','salesman_phone','salesman_resale_name',
  31. 'salesman_status'],
  32. 'info' => ['salesman_id'],
  33. 'update' => ['salesman_id']
  34. ];
  35. }