Topic.php 813 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\api\validate;
  3. use think\Validate;
  4. class Topic extends Validate
  5. {
  6. protected $rule = [
  7. 'topic_id' => 'require|number|between:0,' . PHP_INT_MAX,
  8. 'offset' => 'number|between:0,' . PHP_INT_MAX,
  9. 'limit' => 'number|between:1,500',
  10. 'time_start' => 'number|between:0,' . PHP_INT_MAX,
  11. 'time_end' => 'number|between:0,' . PHP_INT_MAX,
  12. 'orderby' => 'in:id,time,time_add,score,hits,hits_day,hits_week,hits_month,up,down,level',
  13. ];
  14. protected $message = [
  15. ];
  16. protected $scene = [
  17. 'get_list' => [
  18. 'offset',
  19. 'limit',
  20. 'orderby',
  21. 'time_start',
  22. 'time_end',
  23. ],
  24. 'get_detail' => [
  25. 'topic_id',
  26. ],
  27. ];
  28. }