|
|
<?php
|
|
|
|
|
|
class OrderConst {
|
|
|
const orderStatusWaitPay = 1;//在线支付订单待支付;货到付款订单待确认
|
|
|
const orderStatusWaitSellerSendGoods = 2;//备货中(只有此状态下,才可发货)
|
|
|
const orderStatusWaitBuyerConfirmGoods = 3;//已发货
|
|
|
const orderStatusCancel = 4;//已取消:1.用户未支付时取消订单;2.用户超时未支付,系统自动取消订单;3.货到付款订单,用户拒收
|
|
|
const orderStatusFinish = 5;//已完成:1.在线支付订单,商家发货后,用户收货、拒收或者15天无物流更新;2.货到付款订单,用户确认收货
|
|
|
const orderStatusRisk = 105;//105状态:当订单支付成功,但出于特定业务场景处理中(风控核验、拼团待成团等)是,订单状态将推进到105状态,当前状态不允许发货
|
|
|
const orderStatusPartDelivery = 101;//部分发货
|
|
|
|
|
|
const returningAndUserApply = 6;//退货中-用户申请
|
|
|
const returningAndSellerAgree = 7;//退货中-商家同意退货
|
|
|
const returningAndCustomerServiceArbitration = 8;//退货中-客服仲裁
|
|
|
const closeAndReturnGoodsFail = 9;//已关闭-退货失败
|
|
|
const returningAndCustomerServiceAgree = 10;//退货中-客服同意
|
|
|
const returningAndUserFilledInLogistics = 11;//退货中-用户已填物流
|
|
|
const returnGoodsSuccessAndSellerAgree = 12;//退货成功-商户同意
|
|
|
const returningAndAgainCustomerServiceArbitration = 13;//退货中-再次客服仲裁
|
|
|
const returningAndCustomerServiceAgreesToRefund = 14;//退货中-客服同意退款
|
|
|
const returnGoodsAndUserCancel = 15;//退货-用户取消
|
|
|
const refundingAndUserApply = 16;//退款中-用户申请(备货中)
|
|
|
const refundingAndSellerAgreeAndWaitSendGoods = 17;//退款中-商家同意(备货中)
|
|
|
const refundSuccessAndWaitSendGoods = 21;//退款成功-订单退款(备货中,用户申请退款,最终退款成功)
|
|
|
const refundSuccessAndWaitBuyerConfirmGoods = 22;//退款成功-订单退款 (已发货时,用户申请退货,最终退货退款成功)
|
|
|
const returnGoodsSuccessAndSellerAgreeAndCashOnDelivery = 24;//退货成功-商户已退款 (特指货到付款订单,已发货时,用户申请退货,最终退货退款成功)
|
|
|
const refundingAndUserCancel = 25;//退款中-用户取消(备货中)
|
|
|
const refundingAndSellerRefused = 26;//退款中-商家拒绝(备货中)
|
|
|
const returningAndWaitBuyerProcessing = 27;//退货中-等待买家处理(已发货,商家拒绝用户退货申请)
|
|
|
const returnGoodsFail = 28;//退货失败(已发货,商家拒绝用户退货申请,客服仲裁支持商家)
|
|
|
const returningAndWaitBuyerProcessingAndUserFilledInLogistics = 29;//退货中-等待买家处理(已发货,用户填写退货物流,商家拒绝)
|
|
|
const refundingAndRefundApply = 30;//退款中-退款申请(已发货,用户申请仅退款)
|
|
|
const refundApplyCancel = 31;//退款申请取消(已发货,用户申请仅退款时,取消申请)
|
|
|
const refundingAndSellerAgreeAndWaitBuyerConfirmGoods = 32;//退款中-商家同意(已发货,用户申请仅退款,商家同意申请)
|
|
|
const refundingAndSellerRefusedAndWaitBuyerConfirmGoods = 33;//退款中-商家拒绝(已发货,用户申请仅退款,商家拒绝申请)
|
|
|
const refundingAndCustomerServiceArbitration = 34;//退款中-客服仲裁(已发货,用户申请仅退款,商家拒绝申请,买家申请客服仲裁)
|
|
|
const refundingAndCustomerServiceAgree = 35;//退款中-客服同意(已发货,用户申请仅退款,商家拒绝申请,客服仲裁支持买家)
|
|
|
const refundingAndSupportSeller = 36;//退款中-支持商家(已发货,用户申请仅退款,商家拒绝申请,客服仲裁支持商家)
|
|
|
const closeAndRefundFail = 37;//已关闭-退款失败(已发货,用户申请仅退款时,退款关闭)
|
|
|
const refundSuccessAndAfterSales = 38;//退款成功-售后退款(特指货到付款订单,已发货,用户申请仅退款时,最终退款成功)
|
|
|
const refundSuccess = 39;//退款成功-订单退款(已发货,用户申请仅退款时,最终退款成功)
|
|
|
|
|
|
const payTypeHdhk = 0;
|
|
|
const payTypeWechat = 1;
|
|
|
const payTypeAlipay = 2;
|
|
|
const payTypeApplets = 3;
|
|
|
const payTypeBankCard = 4;
|
|
|
const payTypeBalance = 5;
|
|
|
const payTypeNoNeedPayment = 7;
|
|
|
const payTypeCreditPayment = 8;
|
|
|
const payTypeNewCardPayment = 9;
|
|
|
|
|
|
const customPayTypePaid = 'custom_pay_type_paid';
|
|
|
|
|
|
const orderTypeRealGoods = 0;//实物
|
|
|
const orderTypeGeneralVirtual = 2;//普通虚拟
|
|
|
const orderTypePoiWriteOff = 4;//poi核销
|
|
|
const orderTypeTripartiteWriteOff = 5;//三方核销
|
|
|
const orderTypeServiceMarket = 6;//服务市场
|
|
|
|
|
|
const fullnameSearchTypeOld = 'old';
|
|
|
const fullnameSearchTypeNew = 'new';
|
|
|
const mobileSearchTypeOld = 'old';
|
|
|
const mobileSearchTypeNew = 'new';
|
|
|
|
|
|
const addressIsApprovedValuePicking = 1001;//订单已进入拣货环节
|
|
|
const addressApprovedValueDistribution = 1002;//订单已进入配货环节
|
|
|
const addressApprovedValueWarehouse = 1003;//订单已进入仓库环节
|
|
|
const addressApprovedValueOutstorage = 1004;//订单已进入出库环节
|
|
|
const addressApprovedValueDeliver = 1005;//订单已进入发货环节
|
|
|
|
|
|
const orderAddressChangeOperateShopIdSystem = 0;//系统自动审核
|
|
|
const orderAddressChangeOperateShopIdPlatform = 1;//平台自动审核
|
|
|
|
|
|
const delaySendStatusWillDelaySend = 'willDelaySend';
|
|
|
const delaySendStatusHasDelaySend = 'hasDelaySend';
|
|
|
|
|
|
const filterRefundNoRefund = 0;//未退款
|
|
|
const filterRefundPartRefund = 1;//部分退款
|
|
|
const filterRefundAllRefund = 2;//整单退
|
|
|
|
|
|
const sensitiveTypeFullname = 2;
|
|
|
const sensitiveTypeMobile = 3;
|
|
|
const sensitiveTypeAddress = 1;
|
|
|
|
|
|
const opPackageSourcePrint = 'print';
|
|
|
const opPackageSourceManualSend = 'manual_send';
|
|
|
const opPackageSourceDd = 'dd';
|
|
|
const opPackageSourceAutoSend = 'auto_send';
|
|
|
|
|
|
|
|
|
//面单物流状态
|
|
|
const waybillLogisticsStateOutStorage = 13 ; //已发货
|
|
|
const waybillLogisticsStateAccept = 1 ; //已揽收
|
|
|
const waybillLogisticsStateTransit = 0 ; //运输中
|
|
|
const waybillLogisticsStateDelivery = 5 ; //派送中
|
|
|
const waybillLogisticsStateUnpicked = 12 ; //待取件
|
|
|
const waybillLogisticsStateSigned = 3 ; //已签收
|
|
|
|
|
|
const waybillWarningStatusNormal = 'normal';
|
|
|
const waybillWarningStatusAbnormal = 'abnormal';
|
|
|
const waybillWarningStatusWarn = 'warn';
|
|
|
const waybillWarningSettingOn = 'on';
|
|
|
|
|
|
const decryptSourceDsPurchase = 'dsPurchase';
|
|
|
const decryptSourceDsAutoPurchase = 'dsAutoPurchase';
|
|
|
const decryptSourceDsBatchPurchase = 'dsBatchPurchase';
|
|
|
const decryptSourceLtaoPurchase = 'ltaoPurchase';
|
|
|
const decryptSourceSooxiePurchase = 'sooxiePurchase';
|
|
|
const decryptSourcePurchase = 'purchase';
|
|
|
const decryptSourceCustomPrint = 'customPrint';
|
|
|
const decryptSourceAddCustomOrder = 'addCustomOrder';
|
|
|
const decryptSourcePrint = 'print';
|
|
|
const decryptSourcePrintCopy = 'printCopy';
|
|
|
const decryptSourcePrintSingleDecrypt = 'printSingleDecrypt';
|
|
|
const decryptSourcePrintUpdateAddress = 'printUpdateAddress';
|
|
|
const decryptSourceDoMultiPrint = 'doMultiPrint';
|
|
|
const decryptSourceDoBatchPrint = 'doBatchPrint';
|
|
|
const decryptSourceDoSinglePrint = 'doSinglePrint';
|
|
|
const decryptSourceOrderAddressHistory = 'orderAddressHistory';
|
|
|
const decryptSourceAddressAudit = 'addressAudit';
|
|
|
const decryptSourcePluginPurchase = 'pluginPurchase';
|
|
|
const decryptSourceLogisticsReachable = 'logisticsReachable';
|
|
|
const decryptSourceCgPurchase = 'cgPurchase';
|
|
|
const decryptSourceCgPreview = 'cgPreview';
|
|
|
const decryptSourceGoPluginPurchase = 'goPluginPurchase';
|
|
|
const decryptSourceGoCartPurchase = 'goCartPurchase';
|
|
|
const decryptSourcePurchasePageCopy = 'purchasePageCopy';
|
|
|
const decryptSourcePurchaseSingleDecrypt = 'purchaseSingleDecrypt';
|
|
|
const decryptSourceAfterSale = 'afterSale';
|
|
|
|
|
|
const orderBizTypeShopSelf = 8; // 小店自卖
|
|
|
const orderBizTypeAlliance = 2; // 精选联盟
|
|
|
|
|
|
const decryptIpAbnormalTypeOverseas = 'overseas';
|
|
|
const decryptIpAbnormalTypeNotCommonLoginRegion = 'notCommonLoginRegion';
|
|
|
const decryptIpAbnormalTypeNotMatchLoginIp = 'notMatchLoginIp';
|
|
|
|
|
|
const orderTagReceiverAddressChanged = 'receiverAddressChanged';
|
|
|
|
|
|
/**
|
|
|
* 订单同步延迟处理的业务:
|
|
|
* 商品信息
|
|
|
*/
|
|
|
const orderRsyncDelayBizProductInfo = 'productInfo';
|
|
|
|
|
|
public function getClientDecryptSourceList() {
|
|
|
return [
|
|
|
self::decryptSourcePurchase,
|
|
|
self::decryptSourceCustomPrint,
|
|
|
self::decryptSourceAddCustomOrder,
|
|
|
self::decryptSourcePrint,
|
|
|
self::decryptSourcePrintCopy,
|
|
|
self::decryptSourcePrintSingleDecrypt,
|
|
|
self::decryptSourcePrintUpdateAddress,
|
|
|
self::decryptSourceDoMultiPrint,
|
|
|
self::decryptSourceDoBatchPrint,
|
|
|
self::decryptSourceDoSinglePrint,
|
|
|
self::decryptSourceOrderAddressHistory,
|
|
|
self::decryptSourceAddressAudit,
|
|
|
self::decryptSourcePluginPurchase,
|
|
|
self::decryptSourceLogisticsReachable,
|
|
|
self::decryptSourceCgPurchase,
|
|
|
self::decryptSourceCgPreview,
|
|
|
self::decryptSourceGoPluginPurchase,
|
|
|
self::decryptSourceGoCartPurchase,
|
|
|
self::decryptSourcePurchasePageCopy,
|
|
|
self::decryptSourcePurchaseSingleDecrypt,
|
|
|
self::decryptSourceAfterSale,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getDistributeOrderStatusMap() {
|
|
|
return [
|
|
|
'' => '全部',
|
|
|
self::orderStatusWaitSellerSendGoods => '待发货',
|
|
|
self::orderStatusWaitBuyerConfirmGoods => '已发货',
|
|
|
self::orderStatusCancel => '已关闭',
|
|
|
self::orderStatusFinish => '已完成',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getDistributeOrderAfterSaleStatusMap() {
|
|
|
return [
|
|
|
'' => '全部',
|
|
|
2 => '有售后',
|
|
|
1 => '无售后',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getPayTypeMap() {
|
|
|
return [
|
|
|
self::payTypeHdhk => '货到付款',
|
|
|
self::payTypeWechat => '微信',
|
|
|
self::payTypeAlipay => '支付宝',
|
|
|
self::payTypeApplets => '小程序',
|
|
|
self::payTypeBankCard => '银行卡',
|
|
|
self::payTypeBalance => '余额',
|
|
|
self::payTypeNoNeedPayment => '无需支付',
|
|
|
self::payTypeCreditPayment => '放心花(信用支付)',
|
|
|
self::payTypeNewCardPayment => '新卡支付',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getPayTypeText($payType) {
|
|
|
return self::getPayTypeMap()[$payType];
|
|
|
}
|
|
|
|
|
|
public static function getOrderStatusMap() {
|
|
|
return [
|
|
|
self::orderStatusWaitPay => '待付款',
|
|
|
self::orderStatusWaitSellerSendGoods => '待发货',
|
|
|
self::orderStatusWaitBuyerConfirmGoods => '已发货',
|
|
|
self::orderStatusCancel => '已取消',
|
|
|
self::orderStatusFinish => '已完成',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function checkCacheReceiveMobileDecryptSource($decryptSource) {
|
|
|
$noCacheDecryptSourceArr = [
|
|
|
self::decryptSourceCustomPrint,
|
|
|
self::decryptSourceAddCustomOrder,
|
|
|
self::decryptSourcePrint,
|
|
|
self::decryptSourceOrderAddressHistory,
|
|
|
self::decryptSourceAddressAudit,
|
|
|
self::decryptSourceLogisticsReachable,
|
|
|
];
|
|
|
return !in_array($decryptSource, $noCacheDecryptSourceArr);
|
|
|
}
|
|
|
|
|
|
public static function getPriorityOrderStatus() {
|
|
|
return [
|
|
|
OrderConst::orderStatusPartDelivery,
|
|
|
OrderConst::orderStatusWaitSellerSendGoods,
|
|
|
OrderConst::orderStatusWaitBuyerConfirmGoods,
|
|
|
OrderConst::orderStatusFinish,
|
|
|
OrderConst::orderStatusCancel,
|
|
|
OrderConst::orderStatusRisk,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getOrderStatusName($orderStatus) {
|
|
|
return self::getAllOrderStatusMap()[$orderStatus];
|
|
|
}
|
|
|
|
|
|
public static function getPurchaseOrderTabCanceledAllOrderStatus() {
|
|
|
return [
|
|
|
self::orderStatusCancel,
|
|
|
self::returnGoodsSuccessAndSellerAgree,
|
|
|
self::refundSuccessAndWaitSendGoods,
|
|
|
self::refundSuccessAndWaitBuyerConfirmGoods,
|
|
|
self::returnGoodsSuccessAndSellerAgreeAndCashOnDelivery,
|
|
|
self::refundSuccessAndAfterSales,
|
|
|
self::refundSuccess,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getAllOrderStatusMap() {
|
|
|
return [
|
|
|
self::orderStatusWaitPay => '待支付',
|
|
|
self::orderStatusWaitSellerSendGoods => '待发货',
|
|
|
self::orderStatusWaitBuyerConfirmGoods => '已发货',
|
|
|
self::orderStatusCancel => '已取消',
|
|
|
self::orderStatusFinish => '已完成',
|
|
|
self::returningAndUserApply => '退货中-用户申请',
|
|
|
self::returningAndSellerAgree => '退货中-商家同意退货',
|
|
|
self::returningAndCustomerServiceArbitration => '退货中-客服仲裁',
|
|
|
self::closeAndReturnGoodsFail => '已关闭-退货失败',
|
|
|
self::returningAndCustomerServiceAgree => '退货中-客服同意',
|
|
|
self::returningAndUserFilledInLogistics => '退货中-用户已填物流',
|
|
|
self::returnGoodsSuccessAndSellerAgree => '退货成功-商户同意',
|
|
|
self::returningAndAgainCustomerServiceArbitration => '退货中-再次客服仲裁',
|
|
|
self::returningAndCustomerServiceAgreesToRefund => '退货中-客服同意退款',
|
|
|
self::returnGoodsAndUserCancel => '退货-用户取消',
|
|
|
self::refundingAndUserApply => '退款中-用户申请',
|
|
|
self::refundingAndSellerAgreeAndWaitSendGoods => '退款中-商家同意',
|
|
|
self::refundSuccessAndWaitSendGoods => '退款成功-订单退款',
|
|
|
self::refundSuccessAndWaitBuyerConfirmGoods => '退款成功-订单退款',
|
|
|
self::returnGoodsSuccessAndSellerAgreeAndCashOnDelivery => '退货成功-商户已退款',
|
|
|
self::refundingAndUserCancel => '退款中-用户取消',
|
|
|
self::refundingAndSellerRefused => '退款中-商家拒绝',
|
|
|
self::returningAndWaitBuyerProcessing => '退货中-等待买家处理',
|
|
|
self::returnGoodsFail => '退货失败',
|
|
|
self::returningAndWaitBuyerProcessingAndUserFilledInLogistics => '退货中-等待买家处理',
|
|
|
self::refundingAndRefundApply => '退款中-退款申请',
|
|
|
self::refundApplyCancel => '退款申请取消',
|
|
|
self::refundingAndSellerAgreeAndWaitBuyerConfirmGoods => '退款中-商家同意',
|
|
|
self::refundingAndSellerRefusedAndWaitBuyerConfirmGoods => '退款中-商家拒绝',
|
|
|
self::refundingAndCustomerServiceArbitration => '退款中-客服仲裁',
|
|
|
self::refundingAndCustomerServiceAgree => '退款中-客服同意',
|
|
|
self::refundingAndSupportSeller => '退款中-支持商家',
|
|
|
self::closeAndRefundFail => '已关闭-退款失败',
|
|
|
self::refundSuccessAndAfterSales => '退款成功-售后退款',
|
|
|
self::refundSuccess => '退款成功-订单退款',
|
|
|
self::orderStatusRisk => '订单支付成功,风控处理中或待成团',
|
|
|
self::orderStatusPartDelivery => '部分发货',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getOrderStatusText($orderStatus) {
|
|
|
$map = self::getAllOrderStatusMap();
|
|
|
return $map[$orderStatus] ?: null;
|
|
|
}
|
|
|
|
|
|
public static function checkStatusEqual($status1, $status2) {
|
|
|
if ($status1 == $status2) {
|
|
|
return true;
|
|
|
}
|
|
|
if (in_array($status1, [self::orderStatusWaitSellerSendGoods]) && in_array($status2, [self::orderStatusWaitSellerSendGoods])) {
|
|
|
return true;
|
|
|
}
|
|
|
if (in_array($status1, [self::orderStatusWaitBuyerConfirmGoods]) && in_array($status2, [self::orderStatusWaitBuyerConfirmGoods])) {
|
|
|
return true;
|
|
|
}
|
|
|
if (in_array($status1, [self::orderStatusFinish]) && in_array($status2, [self::orderStatusFinish])) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
public static function getCancelOrderReasons() {
|
|
|
return [
|
|
|
'用户重复下单' => '用户重复下单',
|
|
|
'用户不想买了' => '用户不想买了',
|
|
|
'用户买错了/信息填错了,重新下单' => '用户买错了/信息填错了,重新下单',
|
|
|
'联系不上用户' => '联系不上用户',
|
|
|
'快递无法配送至用户地址' => '快递无法配送至用户地址',
|
|
|
'其他' => '其他',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getOrderOutstorageHistoryTagMap() {
|
|
|
return [
|
|
|
'deliveryTimeType' => [
|
|
|
'right_now' => '上游订单发货时立即自动发货',
|
|
|
'logistics_accept' => '上游订单揽收后发货',
|
|
|
'disabled' => '不自动发货',
|
|
|
],
|
|
|
'isPurchaseLogisticsUpdateToPlatform' => [
|
|
|
0 => '不更新物流到下游',
|
|
|
1 => '更新物流到下游',
|
|
|
],
|
|
|
'nearExpShipTime' => [
|
|
|
1 => '物流一直未揽收,系统自动发货,防止发货超时'
|
|
|
],
|
|
|
];
|
|
|
}
|
|
|
}
|