"required|integer", "page_size"=>"required|integer", "type"=>"required:in:1,2" ] ); if($validate->fails()){ //验证错误 $this->setError($validate->errors()->first()); return false; } return true; } /** * 收汁明细参数校验 * @param $data */ public function getFinanceList($data) { $validate = Validator::make($data, [ "page"=>"required|integer", "page_size"=>"required|integer", "finance_type"=>"required|in:0,1,2" ] ); if($validate->fails()){ //验证错误 $this->setError($validate->errors()->first()); return false; } return true; } /** * 流水详情参数校验 * @param $data */ public function getFinanceDetail($data) { $validate = Validator::make($data, [ "id"=>"required|integer", ] ); if($validate->fails()){ //验证错误 $this->setError($validate->errors()->first()); return false; } return true; } /** * 提现参数校验 * @param $data */ public function getCash($data) { $validate = Validator::make($data, [ "amount"=>"required", ] ); if($validate->fails()){ //验证错误 $this->setError($validate->errors()->first()); return false; } return true; } /** * 获取推广二维码参数校验 * @param $data */ public function getRecommendUrl($data) { $validate = Validator::make($data, [ "code"=>"required", ] ); if($validate->fails()){ //验证错误 $this->setError($validate->errors()->first()); return false; } return true; } }