UserValidate.php 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace app\admin\validate\user;
  3. use think\Validate;
  4. class UserValidate extends Validate
  5. {
  6. //定义规则
  7. protected $rule = [
  8. 'user_id' => 'require|number',
  9. 'status' => 'require|in:0,1,2,3',
  10. 'category' => 'require|in:实名认证,会员升级',
  11. 'equipment_intelligence_id' => 'require',
  12. 'equipment_user_id' => 'require',
  13. 'equipment_type' => 'require',
  14. 'equipment_class' => 'require',
  15. 'equipment_status' => 'require',
  16. 'equipment_id' => 'require',
  17. 'relatives_id' => 'require',
  18. 'user_real_name' => 'require',
  19. 'user_card_id' => 'require',
  20. 'user_certinfo' => 'require',
  21. 'user_account' => 'require',
  22. 'user_login_pwd' => 'require',
  23. 'user_again_pwd' => 'require',
  24. 'user_sex' => 'require',
  25. 'user_birthday' => 'require',
  26. 'user_status' => 'require',
  27. 'user_is_owner' => 'require',
  28. 'user_type' => 'require',
  29. 'user_source' => 'require',
  30. 'log_user_id' => 'require',
  31. 'log_type' => 'require',
  32. 'log_doctor_id' => 'require',
  33. 'log_subject_id' => 'require',
  34. 'log_id' => 'require',
  35. 'data_user_id' => 'require',
  36. ];
  37. //定义描述
  38. protected $message = [
  39. 'user_id.require' => '会员编号不能为空',
  40. 'user_id.number' => '会员编号为纯数字',
  41. 'status.require' => '审核状态不能为空',
  42. 'status.in' => '审核状态错误',
  43. 'category.require' => '分类不能为空',
  44. 'category.in' => '分类类型错误',
  45. 'equipment_intelligence_id.require' => '关联智能产品id不能为空',
  46. 'equipment_user_id.require' => '会员编号不能为空',
  47. 'equipment_type.require' => '智能设备类型不能为空',
  48. 'equipment_class.require' => '设备分类不能为空',
  49. 'equipment_status.require' => '智能设备状态不能为空',
  50. 'relatives_id.require' => '亲属关系id不能为空',
  51. 'equipment_id.require' => '智能设备id不能为空',
  52. 'user_real_name.require' => '会员真实姓名不能为空',
  53. 'user_card_id.require' => '会员身份证号不能为空',
  54. 'user_certinfo.require' => '会员认证身份信息不能为空',
  55. 'user_account.require' => '会员账号不能为空',
  56. 'user_login_pwd.require' => '会员登录密码不能为空',
  57. 'user_again_pwd.require' => '会员确认密码不能为空',
  58. 'user_sex.require' => '会员性别不能为空',
  59. 'user_birthday.require' => '会员生日不能为空',
  60. 'user_status.require' => '会员状态不能为空',
  61. 'user_is_owner.require' => '是否是业主不能为空',
  62. 'user_type.require' => '会员身份不能为空',
  63. 'user_source.require' => '会员来源不能为空',
  64. 'log_user_id.require' => '会员id不能为空',
  65. 'log_type.require' => '会员医嘱类型不能为空',
  66. 'log_doctor_id.require' => '医生id不能为空',
  67. 'log_subject_id.require' => '科目id不能为空',
  68. 'log_id.require' => '医嘱id不能为空',
  69. 'data_user_id.require' => '会员id不能为空',
  70. ];
  71. //定义场景
  72. protected $scene = [
  73. 'info' => ['user_id'],
  74. 'create' => ['user_account','user_login_pwd','user_again_pwd','user_sex','user_birthday','user_status','user_is_owner','user_type','user_source'],
  75. 'userAuth' => ['user_real_name','user_card_id','user_certinfo'],
  76. 'auth' => ['user_id', 'status', 'category'],
  77. 'report' => ['user_id'],
  78. 'relatives' => ['relatives_id'],
  79. 'equipment' => ['equipment_intelligence_id','equipment_user_id','equipment_type','equipment_class','equipment_status'],
  80. 'equipmentDel' => ['equipment_id'],
  81. 'userDocter' => ['log_user_id', 'log_type', 'log_doctor_id', 'log_subject_id'],
  82. 'DocterList' => ['log_user_id'],
  83. 'DocterDel' => ['log_user_id', 'log_id'],
  84. 'healthyDel' => ['data_user_id'],
  85. ];
  86. }