12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Http\Validate\Pdd;
- use App\Http\Validate\BaseValidate;
- use Illuminate\Support\Facades\Validator;
- class PddControllerValidate extends BaseValidate
- {
- /**
- * 商品列表参数校验
- * @param $data
- */
- public function getGoodsList($data)
- {
- $validate = Validator::make($data,
- [
- "page"=>"required|integer|min:1",
- ]
- );
- if($validate->fails()){
- //验证错误
- $this->setError($validate->errors()->first());
- return false;
- }
- return true;
- }
- /**
- * 商品推广链接参数校验
- * @param $data
- */
- public function getGoodsRecommendUrl($data)
- {
- $validate = Validator::make($data,
- [
- "goods_sign"=>"required",
- ]
- );
- if($validate->fails()){
- //验证错误
- $this->setError($validate->errors()->first());
- return false;
- }
- return true;
- }
- }
|