CustomValidate.php 794 B

12345678910111213141516171819202122232425262728293031
  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. 'consultant_id|指定顾问' => 'require'
  15. ];
  16. protected $message = [];
  17. protected $scene = [
  18. 'add' => ['mobile', 'type','name', 'gender'],
  19. 'update' => ['id','type', 'name', 'gender'],
  20. 'phone' => ['mobile'],
  21. 'status' => ['id', 'current_status'],
  22. 'check' => ['id', 'check_status']
  23. ];
  24. }