You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
433 B

  1. <?php
  2. namespace App\Service;
  3. class CommonService
  4. {
  5. /**
  6. * 请求参数判空
  7. * @param mixed $var 参数
  8. */
  9. public function empty($var)
  10. {
  11. return ! (
  12. isset($var)
  13. && $var
  14. && !empty($var)
  15. && !is_null($var)
  16. && $var != 'undefined'
  17. && $var != 'unknown'
  18. && $var != 'null'
  19. && $var != 'false'
  20. );
  21. }
  22. }