You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
172 lines
7.2 KiB
PHP
172 lines
7.2 KiB
PHP
<?php
|
|
|
|
class DsOrderConst {
|
|
|
|
const orderStatusWaitPurchase = 'waitPurchase';//待采购
|
|
const orderStatusWaitPay = 'waitPay';//待付款
|
|
const orderStatusWaitSellerSendGoods = 'waitSellerSendGoods';//待发货
|
|
const orderStatusWaitBuyerConfirmGoods = 'waitBuyerConfirmGoods';//已发货
|
|
const orderStatusRefunding = 'refunding';//退款中
|
|
const orderStatusFinish = 'finish';//已完成
|
|
const orderStatusClose = 'close';//已关闭
|
|
const orderStatusIsolation = 'isolation';//已隔离
|
|
|
|
const purchaseTabWaitPurchase = 'waitPurchase';
|
|
const purchaseTabWaitPay = 'waitPay';
|
|
const purchaseTabWaitSend = 'waitSend';
|
|
const purchaseTabHasSend = 'hasSend';
|
|
const purchaseTabRefunding = 'refunding';
|
|
const purchaseTabFinish = 'finish';
|
|
const purchaseTabClose = 'close';
|
|
const purchaseTabIsolation = 'isolation';
|
|
const purchaseTabAll = 'all';
|
|
|
|
const refundStatusRefunding = 'refunding';
|
|
const refundStatusClose = 'close';
|
|
const refundStatusFinish = 'finish';
|
|
|
|
const dsWaitPayStatusPartWaitPay = 1;//部分未付款
|
|
const dsWaitPayStatusFullPay = 2;//已全部付款
|
|
const dsWaitPayStatusAllUnpaid = 3;//全部未付款
|
|
|
|
const dsOrderRelateStateAll = 'all'; //全部
|
|
const dsOrderRelateStateRelated = 'relatedSource';//已关联货源
|
|
const dsOrderRelateStateUnrelated = 'unrelatedSource';//未关联货源
|
|
|
|
const DsRelationSourceStatusNoneProduct = 0;// 未关联货源
|
|
const DsRelationSourceStatusPartProduct = 1;// 部分关联货源
|
|
const DsRelationSourceStatusAllProduct = 2;// 全部关联货源
|
|
|
|
const dsPurchaseStatusWaitPurchase = 0;//待采购
|
|
const dsPurchaseStatusPartPurchase = 1;//部分采购
|
|
const dsPurchaseStatusWaitSend = 2;//待发货
|
|
const dsPurchaseStatusPartSend = 4;//部分发货
|
|
const dsPurchaseStatusWaitPay = 5;//待付款
|
|
const dsPurchaseStatusHasSend = 6;//已发货
|
|
|
|
const filterPurchaseStatusWaitPurchase = '0';
|
|
const filterPurchaseStatusPartPurchase = '1';
|
|
const filterPurchaseStatusHasPurchase = '2';
|
|
const filterPurchaseStatusManualHasPurchase = '3';
|
|
|
|
const actionSourcePlatformBatchPurchase = 'platform_batch_purchase';
|
|
const actionSourcePlatformSinglePurchase = 'platform_single_purchase';
|
|
const actionSourceMobilePlatformBatchPurchase = 'mobile_platform_batch_purchase';
|
|
const actionSourceMobilePlatformSinglePurchase = 'mobile_platform_single_purchase';
|
|
const actionSourcePlatformSingleRepurchase = 'platform_single_repurchase';
|
|
const actionSourcePlatformCancel = 'platform_cancel';
|
|
const actionSourceBatchPurchase = 'batch_purchase';
|
|
const actionSourceSinglePurchase = 'single_purchase';
|
|
const actionSourceCacnel = 'cancel';
|
|
const actionSourcePlatformCloseCancel = 'platform_close_cancel';
|
|
const actionSourceCloseCancel = 'close_cancel';
|
|
const actionSourcePlatformAutoPurchase = 'platform_auto_purchase';
|
|
|
|
const platformProductRelateSourceItemTypeAdd = 'add';
|
|
const platformProductRelateSourceItemTypeDelete = 'delete';
|
|
|
|
const purchaseSourcePlatformBatch = 'platform_batch';
|
|
const purchaseSourceMobilePlatformSingle = 'mobile_platform_single';
|
|
const purchaseSourceMobilePlatformBatch = 'mobile_platform_batch';
|
|
const purchaseSourcePlatformAuto = 'platform_auto';
|
|
const purchaseSourcePlatform = 'platform';
|
|
|
|
const flowFenxiao = 'fenxiao';
|
|
const flowChoiceness = 'ttpft';//精选货源下单
|
|
|
|
const autoAfsActionTypeWaitSendRefund = 'waitSendRefund';
|
|
const autoAfsActionTypeCloseOrder = 'closeOrder';
|
|
const autoAfsActionTypeException = 'exception';
|
|
|
|
public static function getDdOrderStatusAndPlatformOrderStatusMap() {
|
|
return [
|
|
self::orderStatusWaitPurchase => [
|
|
OrderConst::orderStatusWaitSellerSendGoods,
|
|
OrderConst::orderStatusPartDelivery,
|
|
],
|
|
self::orderStatusWaitSellerSendGoods => [
|
|
OrderConst::orderStatusWaitSellerSendGoods,
|
|
OrderConst::orderStatusPartDelivery,
|
|
],
|
|
self::orderStatusWaitBuyerConfirmGoods => [OrderConst::orderStatusWaitBuyerConfirmGoods],
|
|
self::orderStatusFinish => [OrderConst::orderStatusFinish],
|
|
self::orderStatusClose => OrderConst::getPurchaseOrderTabCanceledAllOrderStatus(),
|
|
];
|
|
}
|
|
|
|
public static function getDdOrderStatusByPlatformOrderStatus($appOrderStatus) {
|
|
if (empty($appOrderStatus)) {
|
|
return [];
|
|
}
|
|
$platformOrderStatusAndDdOrderStatusMap = self::getDdOrderStatusAndPlatformOrderStatusMap();
|
|
|
|
$appOrderStatusArr = is_array($appOrderStatus) ? $appOrderStatus : [$appOrderStatus];
|
|
$ddOrderStatusArr = $ddAfterSaleStatusArr = [];
|
|
if (in_array('all', $appOrderStatusArr)) {
|
|
return $ddOrderStatusArr;
|
|
}
|
|
foreach ($appOrderStatusArr as $tmpAppOrderStatus) {
|
|
if ($tmpAppOrderStatus == self::orderStatusRefunding) {
|
|
$ddAfterSaleStatusArr = self::getAppOrderStatusRefundingAfterSaleOrderStatus();
|
|
}
|
|
if (!isset($platformOrderStatusAndDdOrderStatusMap[$tmpAppOrderStatus])) {
|
|
continue;
|
|
}
|
|
$ddOrderStatusArr = array_merge($ddOrderStatusArr, $platformOrderStatusAndDdOrderStatusMap[$tmpAppOrderStatus]);
|
|
}
|
|
|
|
return [$ddOrderStatusArr, $ddAfterSaleStatusArr];
|
|
}
|
|
|
|
public static function getAppOrderStatusByOrderStatus($orderStatus) {
|
|
$map = self::getDdOrderStatusAndPlatformOrderStatusMap();
|
|
|
|
$returnAppOrderStatus = null;
|
|
foreach ($map as $appOrderStatus => $orderStatusArr) {
|
|
if (!in_array($orderStatus, $orderStatusArr)) {
|
|
continue;
|
|
}
|
|
$returnAppOrderStatus = $appOrderStatus;
|
|
}
|
|
|
|
return $returnAppOrderStatus;
|
|
}
|
|
|
|
public static function getDsRefundStatusName($refundStatus) {
|
|
$map = [
|
|
self::refundStatusRefunding => '售后中',
|
|
self::refundStatusClose => '售后关闭',
|
|
self::refundStatusFinish => '售后完成',
|
|
];
|
|
|
|
return $map[$refundStatus] ?: null;
|
|
}
|
|
|
|
public static function getAppOrderStatusRefundingAfterSaleOrderStatus() {
|
|
return [
|
|
AfterSaleConst::aftersaleStatusAfterSaleAudit,
|
|
AfterSaleConst::aftersaleStatusWaitBuyerReturnGoods,
|
|
AfterSaleConst::aftersaleStatusAuditRefunding,
|
|
AfterSaleConst::aftersaleStatusPreSaleAllAudit,
|
|
AfterSaleConst::aftersaleStatusRefundAudit,
|
|
AfterSaleConst::aftersaleStatusReturnAudit,
|
|
AfterSaleConst::aftersaleStatusExchangeAudit,
|
|
AfterSaleConst::aftersaleStatusWaitSellerSendGoods,
|
|
AfterSaleConst::aftersaleStatusReturnReceive,
|
|
AfterSaleConst::aftersaleStatusReturnShip,
|
|
];
|
|
}
|
|
|
|
public static function getActionTypeAndNameMap () {
|
|
return [
|
|
self::autoAfsActionTypeWaitSendRefund => '1688订单申请退款',
|
|
self::autoAfsActionTypeCloseOrder => '关闭1688订单',
|
|
self::autoAfsActionTypeException => '自动售后异常',
|
|
];
|
|
}
|
|
|
|
public static function getActionTypeName($actionType) {
|
|
$actionTypeAndNameMap = self::getActionTypeAndNameMap();
|
|
return $actionTypeAndNameMap[$actionType] ?: '';
|
|
}
|
|
} |