| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- namespace app\extra\douyin;
- use yzh52521\EasyHttp\Http;
- class Client extends Base
- {
- /**
- * 设置小程序跳转path
- * @param string $account
- * @return array
- */
- public function setMiniPath(string $account = "",string $order = ""): array
- {
- $param = [
- "account_id" => $account,
- "bind_biz_type" => 0,
- "path_data_list" => [
- [
- "path" => "pages/order/detail",
- "path_type" => 1
- ],
- [
- "path" => "pages/order/detail",
- "path_type" => 2
- ],
- [
- "path" => "pages/order/detail",
- "path_type" => 3
- ]
- ]
- ];
- return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/apps/trade/v2/toolkit/update_merchant_path/", $param)->array();
- }
- /**
- * 查下用户订单
- * @param string $account
- * @param string $openId
- * @return array
- */
- public function queryOrder(string $account = "",string $openId = ""): array
- {
- $param = [
- "account_id" => $account,
- "open_id" => $openId,
- "biz_type" => 1,
- "time_range" => [
- "start_time" => strtotime("-2 day"),
- "end_time" => time()
- ]
- ];
- return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/trade/v2/fulfillment/query_user_certificates/", $param)->array();
- }
- /**
- * 查询订单可用门店
- * @param string $orderId
- * @return array
- */
- public function queryOrderStore(string $orderId = ""): array
- {
- $param = [
- "order_id" => $orderId
- ];
- return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/trade/v2/fulfillment/order_can_use/", $param)->array();
- }
- /**
- * 查询商家配置文案
- * @return array
- */
- public function getBtnText(): array
- {
- return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/apps/trade/v2/toolkit/query_text/", ["text_type" => 0])->array();
- }
- /**
- * 设置商家配置文案
- * @param string $account
- * @return array
- */
- public function setBtnText(string $account = ""): array
- {
- $param = [
- "account_id" => $account,
- "bind_biz_type" => 0,
- "delivery_app_info" => [
- "button_text_id" => "te7252216917182660619",
- "display_mode" => 2,
- "guidance_text_id"=>"te7249212519187791884"
- ]
- ];
- return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/apps/trade/v2/toolkit/update_merchant_conf/", $param)->array();
- }
- }
|