From 98b1d48f08fa41c1a3e7a04f02956170cb6603ab Mon Sep 17 00:00:00 2001 From: rainbro <33367671@qq.com> Date: Wed, 26 Mar 2025 14:31:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=A4=9A=E5=A4=9A=E6=8C=87=E7=BA=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/api.php | 5 +++++ library/pinduoduo/pdd_api.php | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/control/api.php b/control/api.php index bd4f19d..da150de 100644 --- a/control/api.php +++ b/control/api.php @@ -15,6 +15,8 @@ class api extends publicBase { $order_sn = $this->post('order_sn'); if (empty($order_sn)) $this->ajax_json(false, '订单号不能为空'); + $obj->pati = $this->post('pati') ? $this->post('pati') : ""; + $res = $obj->getOrderInformation($order_sn); // {"order_info_get_response":{"request_id":"16547568855546893","order_info":{"support_nationwide_warranty":0,"country":"中国","group_status":1,"free_sf":0,"discount_amount":0.0,"platform_discount":0.0,"return_freight_payer":0,"order_status":1,"id_card_num":"","risk_control_status":0,"province":"","town_id":0,"item_list":[{"goods_name":"checkpass论文查重无限次数低价免注册查重","outer_goods_id":"","goods_price":1.0,"goods_id":329073007863,"sku_id":1115504481445,"goods_count":1,"goods_spec":"千字符","outer_id":"","goods_img":"https://img.pddpic.com/mms-material-img/2022-03-28/0c075d33-b036-46f7-a0bf-d40774f68190.png.a.jpeg"}],"pay_no":"","last_ship_time":"2022-06-11 14:37:23","delivery_one_day":0,"created_time":"2022-06-09 14:37:14","card_info_list":[],"refund_status":1,"town":"","is_stock_out":0,"receiver_address_mask":"","receive_time":"","pay_time":"2022-06-09 14:37:23","gift_list":[],"capital_free_discount":0.0,"receiver_phone_mask":"13*******67","country_id":0,"city_id":0,"invoice_status":0,"service_fee_detail":[],"city":"","order_tag_list":[{"name":"delivery_one_day","value":0},{"name":"no_trace_delivery","value":0},{"name":"self_contained","value":0},{"name":"return_freight_payer","value":0},{"name":"free_sf","value":0},{"name":"duoduo_wholesale","value":0},{"name":"support_nationwide_warranty","value":0},{"name":"only_support_replace","value":0},{"name":"oversea_tracing","value":0},{"name":"distributional_sale","value":0},{"name":"open_in_festival","value":0},{"name":"same_city_distribution","value":0},{"name":"region_black_delay_shipping","value":0},{"name":"has_subsidy_postage","value":0},{"name":"has_sf_express_service","value":0},{"name":"community_group","value":0},{"name":"has_ship_additional","value":0},{"name":"ship_additional_order","value":0}],"is_lucky_flag":1,"yyps_time":"","mkt_biz_type":0,"shipping_type":0,"remark":"","pre_sale_time":"","inner_transaction_id":"","order_change_amount":0.0,"only_support_replace":0,"logistics_id":0,"updated_at":"2022-06-09 14:37:33","street":"","receiver_name_mask":"","receiver_name":"","tracking_number":"","pay_type":"","duoduo_wholesale":0,"buyer_memo":"","is_pre_sale":0,"shipping_time":"","home_delivery_type":0,"after_sales_status":0,"address":"","id_card_name":"","self_contained":0,"goods_amount":1.0,"pay_amount":1.0,"seller_discount":0.0,"address_mask":"","yyps_date":"","confirm_status":1,"confirm_time":"2022-06-09 14:37:23","stock_out_handle_status":-1,"postage":0.0,"province_id":0,"cat_id_3":9056,"cat_id_4":0,"cat_id_1":8726,"receiver_address":"","cat_id_2":8786,"trade_type":0,"urge_shipping_time":"","receiver_phone":"$3MpaxbKBnse9$AgAAAAF2+qYGan7+ggANYOk6e6B2tcD3m4NUAgu6bY4=$0$$","order_sn":"220609-635730697112661"}}} $res = json_decode($res, true); @@ -46,6 +48,7 @@ class api extends publicBase { $outer_goods_ids = is_array($outer_goods_ids) && count($outer_goods_ids)>0 ? implode(',', $outer_goods_ids) : array(); + $obj->pati = $this->post('pati') ? $this->post('pati') : ""; $res = $obj->getGoodsList($goods_name, $outer_goods_ids); // {"goods_list_get_response":{"goods_list":[{"is_more_sku":1,"goods_name":"checkpass论文查重无限次数低价免注册查重","thumb_url":"https://img.pddpic.com/gaudit-image/2022-03-28/edac0af376a509b227714488bd5dfa37.jpeg","goods_reserve_quantity":0,"image_url":"","sku_list":[{"outer_goods_id":"","is_sku_onsale":1,"reserve_quantity":0,"sku_id":1115504481445,"outer_id":"","spec":"千字符","sku_quantity":1277},{"outer_goods_id":"","is_sku_onsale":1,"reserve_quantity":0,"sku_id":1115476736663,"outer_id":"","spec":"无限次数","sku_quantity":1495}],"goods_quantity":2772,"goods_id":329073007863,"is_onsale":1}],"total_count":1,"request_id":"16551061312578732"}} @@ -64,6 +67,7 @@ class api extends publicBase { $goods_id = $this->post('goods_id'); if (empty($goods_id)) $this->ajax_json(false, '商品编码不能为空'); + $obj->pati = $this->post('pati') ? $this->post('pati') : ""; $res = $obj->getGoodsInformation($goods_id); // {"goods_info_get_response":{"goods_info":{"goods_name":"checkpass论文查重无限次数低价免注册查重","last_category":"论文检测与查询","image_url":"","shipment_limit_second":"172800","goods_quantity":2772,"goods_id":"329073007863","goods_sn":"329073007863","goods_category":"教育培训","is_onsale":"1","is_refundable":"0","second_hand":0,"sku_list":[{"single_price":"12.00","sku_img":"https://img.pddpic.com/mms-material-img/2022-03-28/3cd06438-b959-42ac-936a-93c273367355.png.a.jpeg","outer_goods_id":"","is_sku_onsale":"1","sku_id":"1115476736663","group_price":"10.00","outer_id":"","spec":"无限次数","sku_quantity":"1495"},{"single_price":"2.00","sku_img":"https://img.pddpic.com/mms-material-img/2022-03-28/0c075d33-b036-46f7-a0bf-d40774f68190.png.a.jpeg","outer_goods_id":"","is_sku_onsale":"1","sku_id":"1115504481445","group_price":"1.00","outer_id":"","spec":"千字符","sku_quantity":"1277"}],"goods_type":"1","group_required_customer_num":"2"},"request_id":"16551080285427607"}} @@ -80,6 +84,7 @@ class api extends publicBase { $tids = $this->post('order_sns'); if (empty($tids)) $this->ajax_json(false, '订单编号不能为空'); + $obj->pati = $this->post('pati') ? $this->post('pati') : ""; $res = $obj->getOrderStatus($tids); $res = json_decode($res, true); diff --git a/library/pinduoduo/pdd_api.php b/library/pinduoduo/pdd_api.php index 1d6e31b..dc31cb7 100644 --- a/library/pinduoduo/pdd_api.php +++ b/library/pinduoduo/pdd_api.php @@ -22,6 +22,8 @@ class PDD { public $client_secret; public $access_token = ''; // 非必填参数 用户授权令牌access_token,通过pdd.pop.auth.token.create获取 + public $pati; + public function __construct($client_id, $client_secret, $access_token=null) { $this->client_id = $client_id; $this->client_secret = $client_secret; @@ -283,7 +285,7 @@ class PDD { */ public function deleteDdyPdpUser($owner_id) { $params['type'] = 'pdd.ddy.pdp.user.delete'; - $params['$owner_id'] = $owner_id; + $params['owner_id'] = $owner_id; return $this->getPostRequestResult($params); } @@ -341,6 +343,11 @@ class PDD { public function postRequest($data) { $ch = curl_init(); + if ($this->pati) { + $this->request_headers[] = "X-PDD-Pati:".$this->pati; + } + error_log(date("Y-m-d H:i:s")."|".json_encode($this->request_headers)."\n", 3, './postRequest.log'); + curl_setopt($ch, CURLOPT_HTTPHEADER, $this->request_headers); //分析是否开启SSL加密 -- 1.8.3.1