98 lines
3.6 KiB
PHP
98 lines
3.6 KiB
PHP
<?php
|
||
|
||
namespace App\Services\Business\KuaiTuanTuan;
|
||
|
||
class Order
|
||
{
|
||
/**
|
||
* 根据成交时间拉取订单列表
|
||
*/
|
||
public static function downloadOrders($beginTime, $endTime, $page = 1)
|
||
{
|
||
$type = 'pdd.ktt.order.list';
|
||
$appendParams = [
|
||
'confirm_at_begin' => $beginTime, // 成交启始时间, 必填,毫秒时间戳
|
||
'confirm_at_end' => $endTime, // 成交结束时间,必填, 毫秒时间戳,成交结束时间 - 成交启始时间 <= 24h
|
||
'page_number' => $page, // 页码, 必填
|
||
'page_size' => 100, // 数量, 必填, 1~100
|
||
// 非必填
|
||
// 'activity_no' => $activityNo, // 团号
|
||
// 'after_sales_status' => 0, // 售后状态, 可选 0-未发起售后 1-退款中 2-退款成功 3-待处理 4-拒绝退款 6-待(顾客)退货 7-待(团长)确认退货 8-(顾客)撤销 9-(系统)关闭
|
||
// 'cancel_status' => 0, // 取消状态, 可选 0-未取消 1-已取消
|
||
// 'shipping_status' => '', // 发货状态 0-未发货 1-已发货 2-部分发货 3-已收货
|
||
// 'verification_status' => '', // 核销状态, 可选 0-未核销 1-已核销 2-部分核销
|
||
];
|
||
|
||
return [$type, $appendParams];
|
||
}
|
||
|
||
/**
|
||
* 快团团增量查订单
|
||
*/
|
||
public static function downloadIncrementOrders($beginTime, $endTime, $page = 1)
|
||
{
|
||
$type = 'pdd.ktt.increment.order.query';
|
||
$appendParams = [
|
||
'start_updated_at' => $beginTime, // 更新起始时间
|
||
'end_updated_at' => $endTime, // 更新结束时间
|
||
'page_number' => $page, // 页码
|
||
'page_size' => 100, // 数量
|
||
// 非必填
|
||
// 'activity_no' => $activityNo, // 团号
|
||
// 'after_sales_status' => 0, // 售后状态, 可选 0-未发起售后 1-退款中 2-退款成功 3-待处理 4-拒绝退款 6-待(顾客)退货 7-待(团长)确认退货 8-(顾客)撤销 9-(系统)关闭
|
||
// 'cancel_status' => 0, // 取消状态, 可选 0-未取消 1-已取消
|
||
// 'shipping_status' => '', // 发货状态 0-未发货 1-已发货 2-部分发货 3-已收货
|
||
// 'verification_status' => '', // 核销状态, 可选 0-未核销 1-已核销 2-部分核销
|
||
];
|
||
|
||
return [$type, $appendParams];
|
||
}
|
||
|
||
public static function getOrderInfo($orderSn)
|
||
{
|
||
$type = 'pdd.ktt.order.get';
|
||
$appendParams = [
|
||
'order_sn' => $orderSn,
|
||
];
|
||
|
||
return [$type, $appendParams];
|
||
}
|
||
|
||
public static function getLogisticsCompanies()
|
||
{
|
||
$type = 'pdd.logistics.companies.get';
|
||
|
||
return [$type, []];
|
||
}
|
||
|
||
|
||
public static function createOrderLogistic($orderSn, $waybillNo, $logisticsId = 44, $logisticsName = '顺丰快递')
|
||
{
|
||
// 不支持拆单发货
|
||
$type = 'pdd.ktt.order.logistic.create';
|
||
$appendParams = [
|
||
'logisticsId' => $logisticsId,
|
||
'logisticsName' => $logisticsName,
|
||
'orderSn' => $orderSn,
|
||
// 'subOrderSnList' => [], 发货子单号列表,无子单号视为整单发货
|
||
'waybillNo' => $waybillNo,
|
||
];
|
||
|
||
return [$type, $appendParams];
|
||
}
|
||
|
||
public static function deleteOrderLogistic($orderSn, $waybillNo)
|
||
{
|
||
$type = 'pdd.ktt.order.logistic.delete';
|
||
$appendParams = [
|
||
'orderSn' => $orderSn,
|
||
// 'subOrderSnList' => [], 发货子单号列表,无子单号视为整单发货
|
||
'waybillNo' => $waybillNo,
|
||
];
|
||
|
||
return [$type, $appendParams];
|
||
}
|
||
|
||
}
|
||
|