123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Http\Validate\Home;
- use App\Http\Validate\BaseValidate;
- use Illuminate\Support\Facades\Validator;
- class HomeControllerValidate extends BaseValidate
- {
- /**
- * 反钱赚钱参数校验
- * @param $data
- */
- public function getCommissionList($data)
- {
- $validate = Validator::make($data,
- [
- "page"=>"required|integer",
- "page_size"=>"required|integer",
- "type"=>"required|in:0,1",
- ]
- );
- if($validate->fails()){
- //验证错误
- $this->setError($validate->errors()->first());
- return false;
- }
- return true;
- }
- }
|