ExpressService.php 684 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2018/01/10
  6. */
  7. namespace crmeb\services;
  8. use crmeb\services\HttpService;
  9. use crmeb\services\SystemConfigService;
  10. class ExpressService
  11. {
  12. protected static $api = [
  13. 'query' => 'https://wuliu.market.alicloudapi.com/kdi'
  14. ];
  15. public static function query($no, $type = '')
  16. {
  17. $appCode = sys_config('system_express_app_code');
  18. if (!$appCode) return false;
  19. $res = HttpService::getRequest(self::$api['query'], compact('no', 'type'), ['Authorization:APPCODE ' . $appCode]);
  20. $result = json_decode($res, true) ?: false;
  21. return $result;
  22. }
  23. }