截流自动化的商城平台
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.

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace expressage;
  3. use Requests;
  4. class Kd100 extends Expressage
  5. {
  6. public function logistics($code, $number, $extra = "")
  7. {
  8. $request_data = '{"com":"' . $code . '","num":"' . $number . '","from":"","phone":"' . $extra . '","to":"","resultv2":"0","show":"0","order":"desc"}';
  9. $datas = array(
  10. 'customer' => $this->app,
  11. 'sign' => strtoupper(md5($request_data . $this->key . $this->app)),
  12. 'param' => $request_data,
  13. );
  14. $params = "";
  15. foreach ($datas as $k => $v) {
  16. $params .= "$k=" . urlencode($v) . "&";
  17. }
  18. $params = substr($params, 0, -1);
  19. $result = Requests::get('http://poll.kuaidi100.com/poll/query.do?' . $params);
  20. $result = json_decode($result->body, true);
  21. if (isset($result['data'])) {
  22. $this->logistics_info = $result['data'];
  23. $this->logistics_info;
  24. }
  25. $this->error = json_encode($result, JSON_UNESCAPED_UNICODE);
  26. return false;
  27. }
  28. }