HomeControllerValidate.php 695 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Validate\Home;
  3. use App\Http\Validate\BaseValidate;
  4. use Illuminate\Support\Facades\Validator;
  5. class HomeControllerValidate extends BaseValidate
  6. {
  7. /**
  8. * 反钱赚钱参数校验
  9. * @param $data
  10. */
  11. public function getCommissionList($data)
  12. {
  13. $validate = Validator::make($data,
  14. [
  15. "page"=>"required|integer",
  16. "page_size"=>"required|integer",
  17. "type"=>"required|in:0,1",
  18. ]
  19. );
  20. if($validate->fails()){
  21. //验证错误
  22. $this->setError($validate->errors()->first());
  23. return false;
  24. }
  25. return true;
  26. }
  27. }