ReqOrder.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\admin\validate;
  3. use think\Validate;
  4. class ReqOrder extends Validate
  5. {
  6. protected $failException = true;
  7. /**
  8. * 验证规则
  9. */
  10. protected $rule = [
  11. "city"=>'require',
  12. "act_time"=>'require|date|dateFormat:Y-m-d H:i:s',
  13. "participant"=>'require|number|in:0,1,2',
  14. "budget"=>'require|float',
  15. "require_item"=>'require|max:255',
  16. "req_corp"=>'number',
  17. "phone"=>'require|mobile',
  18. ];
  19. /**
  20. * 提示消息
  21. */
  22. protected $message = [
  23. "city"=>"请选择活动城市",
  24. "act_time"=>"请选择活动时间",
  25. "participant"=>"请选择活动人数",
  26. "budget"=>"请输入活动预算",
  27. "require_item"=>"请选择活动类型",
  28. "phone"=>"请输入正确的联系方式",
  29. // "require_item"=>"请选择活动类型",
  30. ];
  31. /**
  32. * 验证场景
  33. */
  34. protected $scene = [
  35. 'add' => ["city","act_time","participant","budget","require_item","phone",],
  36. 'edit' => ["city","act_time","participant","budget","require_item","phone",],
  37. ];
  38. public function __construct() {
  39. parent::__construct();
  40. }
  41. }