Leads.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace addons\qingdongams\validate;
  3. use think\Validate;
  4. class Leads extends Validate {
  5. /**
  6. * 验证规则
  7. */
  8. protected $rule = [
  9. 'create_staff_id' => 'require|number',
  10. 'owner_staff_id' => 'require|number',
  11. 'name' => 'require|max:50',
  12. 'sex' => 'between:0,2',
  13. 'level' => 'number|between:1,5',
  14. 'telephone' => 'max:32',
  15. 'mobile' => 'max:32',
  16. 'industry' => 'max:50',
  17. 'source' => 'max:50',
  18. 'follow' => 'max:50',
  19. 'address' => 'max:50',
  20. 'address_detail' => 'max:50',
  21. 'remarks' => 'max:250',
  22. ];
  23. /**
  24. * 提示消息
  25. */
  26. protected $message = [];
  27. /**
  28. * 字段描述
  29. */
  30. protected $field = [
  31. 'create_staff_id' => '员工',
  32. 'owner_staff_id' => '员工',
  33. 'name' => '线索名称',
  34. 'sex' => '性别',
  35. 'telephone' => '电话',
  36. 'mobile' => '手机号',
  37. 'industry' => '所属行业',
  38. 'level' => '客户星级',
  39. 'follow' => '客户状态',
  40. 'source' => '客户来源',
  41. 'address' => '所在地区',
  42. 'address_detail' => '详细地址',
  43. 'remark' => '备注',
  44. ];
  45. /**
  46. * 验证场景
  47. */
  48. protected $scene = [
  49. 'create' => ['name', 'sex', 'telephone', 'mobile', 'industry', 'level', 'follow', 'source', 'address', 'address_detail', 'remark'],
  50. 'edit' => [],
  51. ];
  52. }