PropertyUserValidate.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\validate\property;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * PropertyUser验证器
  18. * Class PropertyUserValidate
  19. * @package app\adminapi\validate
  20. */
  21. class PropertyUserValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'property_head_id' => 'require',
  30. 'householder_name' => 'require',
  31. 'householder_mobile' => 'require',
  32. 'address' => 'require',
  33. 'user_id' => 'require',
  34. ];
  35. /**
  36. * 参数描述
  37. * @var string[]
  38. */
  39. protected $field = [
  40. 'id' => 'id',
  41. 'property_head_id' => '物业负责人ID',
  42. 'householder_name' => '户主人名称',
  43. 'householder_mobile' => '户主手机号/电话',
  44. 'address' => '详细地址',
  45. 'user_id' => '注册用户ID',
  46. ];
  47. /**
  48. * @notes 添加场景
  49. * @return PropertyUserValidate
  50. * @author likeadmin
  51. * @date 2024/09/19 14:35
  52. */
  53. public function sceneAdd()
  54. {
  55. return $this->only(['property_head_id','householder_name','householder_mobile','address','user_id']);
  56. }
  57. /**
  58. * @notes 编辑场景
  59. * @return PropertyUserValidate
  60. * @author likeadmin
  61. * @date 2024/09/19 14:35
  62. */
  63. public function sceneEdit()
  64. {
  65. return $this->only(['id','property_head_id','householder_name','householder_mobile','address','user_id']);
  66. }
  67. /**
  68. * @notes 删除场景
  69. * @return PropertyUserValidate
  70. * @author likeadmin
  71. * @date 2024/09/19 14:35
  72. */
  73. public function sceneDelete()
  74. {
  75. return $this->only(['id']);
  76. }
  77. /**
  78. * @notes 详情场景
  79. * @return PropertyUserValidate
  80. * @author likeadmin
  81. * @date 2024/09/19 14:35
  82. */
  83. public function sceneDetail()
  84. {
  85. return $this->only(['id']);
  86. }
  87. }