ContractRequest.php 973 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2019/5/10 0010
  6. * Time: 14:13
  7. */
  8. namespace App\Http\Requests\Report;
  9. use App\Http\Requests\Request;
  10. class ContractRequest extends Request
  11. {
  12. /**
  13. * Determine if the user is authorized to make this request.
  14. *
  15. * @return bool
  16. */
  17. public function authorize()
  18. {
  19. return true;
  20. }
  21. /**
  22. * Get the validation rules that apply to the request.
  23. *
  24. * @return array
  25. */
  26. public function rules()
  27. {
  28. if (!$this->ajax()) {
  29. return [];
  30. }
  31. return [
  32. 'key_num' => 'nullable|numeric',
  33. 'article_num' => 'nullable|numeric',
  34. 'link_num' => 'nullable|numeric'
  35. ];
  36. }
  37. public function attributes()
  38. {
  39. return [
  40. 'key_num' => '关键词合同数',
  41. 'article_num' => '软文合同数',
  42. 'link_num' => '营销合同数',
  43. ];
  44. }
  45. }