CronControllerValidate.php 722 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Http\Validate\Cron;
  3. use App\Http\Validate\BaseValidate;
  4. use Illuminate\Support\Facades\Validator;
  5. class CronControllerValidate extends BaseValidate
  6. {
  7. /**
  8. * 美团参数校验
  9. * @param $data
  10. */
  11. public function meituanOrders($data)
  12. {
  13. $validate = Validator::make($data,
  14. [
  15. "order_type"=>"required|in:0,2,4,5,6,8",//0团购2酒店4外卖5话费&好货订单6闪购8优选
  16. "minute"=>"required"//几分钟前的订单
  17. ]
  18. );
  19. if($validate->fails()){
  20. //验证错误
  21. $this->setError($validate->errors()->first());
  22. return false;
  23. }
  24. return true;
  25. }
  26. }