CustomValidate.php 743 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\wechat\validate;
  3. use support\Validate;
  4. class CustomValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'id|ID' => 'require|integer',
  8. 'mobile|联系电话' => 'require|mobile',
  9. 'name|客户姓名' => 'require',
  10. 'gender|客户性别' => 'require',
  11. 'type|来访方式' => 'require',
  12. 'current_status|当前状态' => 'require',
  13. 'check_status|报备状态' => 'require'
  14. ];
  15. protected $message = [];
  16. protected $scene = [
  17. 'add' => ['mobile', 'type','name', 'gender'],
  18. 'update' => ['id','type', 'name', 'gender'],
  19. 'phone' => ['mobile'],
  20. 'status' => ['id', 'current_status'],
  21. 'check' => ['id', 'check_status']
  22. ];
  23. }