Client.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace app\extra\douyin;
  3. use yzh52521\EasyHttp\Http;
  4. class Client extends Base
  5. {
  6. /**
  7. * 设置小程序跳转path
  8. * @param string $account
  9. * @return array
  10. */
  11. public function setMiniPath(string $account = "",string $order = ""): array
  12. {
  13. $param = [
  14. "account_id" => $account,
  15. "bind_biz_type" => 0,
  16. "path_data_list" => [
  17. [
  18. "path" => "pages/order/detail",
  19. "path_type" => 1
  20. ],
  21. [
  22. "path" => "pages/order/detail",
  23. "path_type" => 2
  24. ],
  25. [
  26. "path" => "pages/order/detail",
  27. "path_type" => 3
  28. ]
  29. ]
  30. ];
  31. return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/apps/trade/v2/toolkit/update_merchant_path/", $param)->array();
  32. }
  33. /**
  34. * 查下用户订单
  35. * @param string $account
  36. * @param string $openId
  37. * @return array
  38. */
  39. public function queryOrder(string $account = "",string $openId = ""): array
  40. {
  41. $param = [
  42. "account_id" => $account,
  43. "open_id" => $openId,
  44. "biz_type" => 1,
  45. "time_range" => [
  46. "start_time" => strtotime("-120 min"),
  47. "end_time" => strtotime("+120 min")
  48. ]
  49. ];
  50. return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/trade/v2/fulfillment/query_user_certificates/", $param)->array();
  51. }
  52. }