Quote.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace addons\qingdongams\validate;
  3. use think\Validate;
  4. class Quote extends Validate {
  5. /**
  6. * 验证规则
  7. */
  8. protected $rule = [
  9. 'create_staff_id' => 'number',
  10. 'number' => 'max:50',
  11. 'contacts_id' => 'number',
  12. 'customer_id' => 'number',
  13. 'quote_date' => 'max:50',
  14. 'product_ids' => 'max:250',
  15. 'discount_amount' => 'max:250',
  16. 'quote_amount' => 'max:250',
  17. ];
  18. /**
  19. * 提示消息
  20. */
  21. protected $message = [];
  22. /**
  23. * 字段描述
  24. */
  25. protected $field = [
  26. 'create_staff_id' => '创建人',
  27. 'number' => '产品编码',
  28. 'customer_id' => '客户',
  29. 'contacts_id' => '客户联系人',
  30. 'quote_date' => '报价时间',
  31. 'discount_amount' => '优惠金额',
  32. 'quote_amount' => '报价金额',
  33. ];
  34. /**
  35. * 验证场景
  36. */
  37. protected $scene = [
  38. 'create' => [
  39. 'create_staff_id',
  40. 'number',
  41. 'customer_id',
  42. 'contacts_id',
  43. 'quote_date',
  44. 'discount_amount',
  45. 'quote_amount',
  46. ],
  47. 'edit' => [],
  48. ];
  49. }