Contacts.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. namespace addons\qingdongams\validate;
  3. use think\Validate;
  4. //l联系人
  5. class Contacts extends Validate {
  6. /**
  7. * 验证规则
  8. */
  9. protected $rule = [
  10. 'create_staff_id' => 'require|number',
  11. 'owner_staff_id' => 'require|number',
  12. 'customer_id' => 'require|number',
  13. 'name' => 'require|max:50',
  14. 'mobile' => 'max:32',
  15. 'subname' => 'max:50',
  16. 'sex' => 'number|between:0,2',
  17. 'role' => 'max:32',
  18. 'post' => 'max:32',
  19. 'birthday' => 'max:32',
  20. 'email' => 'email|max:32',
  21. 'telephone' => 'max:32',
  22. 'wechat' => 'max:32',
  23. 'qq' => 'max:32',
  24. 'address' => 'max:64',
  25. 'address_detail' => 'max:64',
  26. 'remarks' => 'max:250',
  27. ];
  28. /**
  29. * 提示消息
  30. */
  31. protected $message = [];
  32. /**
  33. * 字段描述
  34. */
  35. protected $field = [
  36. 'create_staff_id' => '员工',
  37. 'owner_staff_id' => '员工',
  38. 'customer_id' => '所属客户',
  39. 'name' => '联系人名称',
  40. 'subname' => '助记名称',
  41. 'mobile' => '手机号',
  42. 'sex' => '性别',
  43. 'role' => '角色',
  44. 'post' => '职务',
  45. 'birthday' => '生日',
  46. 'email' => '邮箱',
  47. 'telephone' => '座机',
  48. 'wechat' => '微信号',
  49. 'qq' => 'qq',
  50. 'address' => '所在地区',
  51. 'address_detail' => '详细地址',
  52. 'remarks' => '备注信息',
  53. ];
  54. /**
  55. * 验证场景
  56. */
  57. protected $scene = [
  58. 'create' => [
  59. 'name',
  60. 'subname',
  61. 'mobile',
  62. 'sex',
  63. 'role',
  64. 'post',
  65. 'birthday',
  66. 'email',
  67. 'telephone',
  68. 'wechat',
  69. 'qq',
  70. 'address',
  71. 'address_detail',
  72. 'remarks'
  73. ],
  74. 'edit' => [
  75. 'name',
  76. 'subname',
  77. 'mobile',
  78. 'sex',
  79. 'role',
  80. 'post',
  81. 'birthday',
  82. 'email',
  83. 'telephone',
  84. 'wechat',
  85. 'qq',
  86. 'address',
  87. 'address_detail',
  88. 'remarks'
  89. ],
  90. ];
  91. }