|
|
<?php
|
|
|
|
|
|
class PurchaseOrderConst {
|
|
|
|
|
|
const purchaseOrderTabAll = 'all';
|
|
|
const purchaseOrderTabWaitPurchase = 'wait_purchase';
|
|
|
const purchaseOrderTabWaitSend = 'wait_send';
|
|
|
const purchaseOrderTabHasSend = 'has_send';
|
|
|
const purchaseOrderTabFinished = 'finished';
|
|
|
const purchaseOrderTabReturn = 'return';
|
|
|
const purchaseOrderTabCanceled = 'canceled';
|
|
|
const purchaseOrderTabIsolation = 'isolation';
|
|
|
const purchaseOrderTabRisk = 'risk';
|
|
|
const purchaseOrderTabSpeedRefund = 'speed_refund';
|
|
|
|
|
|
const purchaseOrderStatusWaitPay = 'wait_pay';
|
|
|
const purchaseOrderStatusWaitSend = 'wait_send';
|
|
|
const purchaseOrderStatusHasSend = 'has_send';
|
|
|
const purchaseOrderStatusFinished = 'finished';
|
|
|
const purchaseOrderStatusCancel = 'cancel';
|
|
|
const purchaseOrderStatusRefund = 'refund';
|
|
|
const purchaseOrderStatusRefunded = 'refunded';
|
|
|
|
|
|
const filterPurchaseStatusWaitPurchase = '0';
|
|
|
const filterPurchaseStatusPartPurchase = '1';
|
|
|
const filterPurchaseStatusHasPurchase = '2';
|
|
|
const filterPurchaseStatusManualHasPurchase = '3';
|
|
|
|
|
|
const purchaseOrderTypeSupplement = 'supplement';
|
|
|
|
|
|
const purchasePlatformTaobao = 'taobao';
|
|
|
const purchasePlatformPdd = 'yangkeduo';
|
|
|
const purchasePlatformTmall = 'tmall';
|
|
|
const purchasePlatform1688 = '1688';
|
|
|
const purchasePlatformJd = 'jd';
|
|
|
const purchasePlatformWsy = 'wsy';
|
|
|
const purchasePlatformSooxie = 'sooxie';
|
|
|
const purchasePlatformVvic = 'vvic';
|
|
|
const purchasePlatform17qcc = '17qcc';
|
|
|
const purchasePlatformZhe800 = 'zhe800';
|
|
|
const purchasePlatform17zwd = '17zwd';
|
|
|
const purchasePlatformHznzcn = 'hznzcn';
|
|
|
const purchasePlatformFzyj0591 = 'fzyj0591';
|
|
|
const purchasePlatformBao66 = 'bao66';
|
|
|
const purchasePlatformK3 = 'k3';
|
|
|
const purchasePlatformXingfujie = 'xingfujie';
|
|
|
const purchasePlatform2tong = '2tong';
|
|
|
const purchasePlatformJuyi5 = 'juyi5';
|
|
|
const purchasePlatform3e = '3e';
|
|
|
const purchasePlatformKongfz = 'kongfz';
|
|
|
const purchasePlatformOther = 'other';
|
|
|
const purchasePlatform1688DS = '1688DS';
|
|
|
const purchasePlatformJp0663 = 'jp0663';
|
|
|
const purchasePlatform52dsy = '52dsy';
|
|
|
const purchasePlatformTaote = 'taote';
|
|
|
const purchasePlatformYiwugou = 'yiwugou';
|
|
|
const purchasePlatform1688CG = '1688CG';
|
|
|
const purchasePlatform91fj = '91jf';
|
|
|
const purchasePlatformYoupizhijia = 'youpizhijia';
|
|
|
|
|
|
const alliancePlatformAlimama = 'alimama';
|
|
|
const alliancePlatformDdk = 'ddk';
|
|
|
const alliancePlatformAlimamaFromTaobao = 'taobao';
|
|
|
const alliancePlatformAlimamaFromAlimama = 'alimama';
|
|
|
|
|
|
const purchasePlatformField = 'purchase_platform';
|
|
|
const purchasePaymentField = 'purchase_payment';
|
|
|
const totalProfitField = 'total_profit';
|
|
|
const logisticsInfoField = 'logistics_info';
|
|
|
const purchaseOrderBuyer = 'purchase_order_buyer';
|
|
|
const purchaseOrderSnField = 'purchase_order_sn';
|
|
|
const purchaseOrderSellerField = 'purchase_order_seller';
|
|
|
const customField = 'custom';
|
|
|
|
|
|
const sameReceiveInfoTipFieldReceiverName = 'receiver_name';
|
|
|
const sameReceiveInfoTipFieldReceiverPhone = 'receiver_phone';
|
|
|
const sameReceiveInfoTipFieldReceiverAddress = 'address';
|
|
|
|
|
|
const purchase1688TypePromptGoods = 'prompt_goods';
|
|
|
const purchase1688TypeDistribuition = 'distribution';
|
|
|
const purchase1688TypeUsePurchaseUrl = 'use_purchase_url';
|
|
|
|
|
|
const purchase1688AddressTypeTemporarily = 'temporarily';
|
|
|
const purchase1688AddressTypeFixed = 'fixed';
|
|
|
|
|
|
const autoShipmentTypeImmediately = 'immediately';
|
|
|
const autoShipmentTypeAfterAccept = 'after_accept';
|
|
|
const autoShipmentTypeNextDay = 'next_day';
|
|
|
|
|
|
const purchaseUrlSourceMove = 1;
|
|
|
const purchaseUrlSourceManual = 2;
|
|
|
|
|
|
const purchaseVersionOld = '1';
|
|
|
const purchaseVersionNew = '2';
|
|
|
|
|
|
const outstorageSourceTask = 'task';
|
|
|
const outstorageSourceQuick = 'quick';
|
|
|
const outstorageSourceAuto = 'auto';
|
|
|
const outstorageSourceManual = 'manual';
|
|
|
const outstorageSourceAutoRetry = 'autoRetry';
|
|
|
const outstorageSourceScanManual = 'scan_manual';
|
|
|
const outstorageSourceScanAuto = 'scan_auto';
|
|
|
const outstorageSourcePrintBatch = 'print_batch';
|
|
|
const outstorageSourcePrintSingle = 'print_single';
|
|
|
const outstorageSourceImport = 'import';
|
|
|
const outstorageSourcePreAuto = 'pre_auto';
|
|
|
const outstorageSourcePreManual = 'pre_manual';
|
|
|
const outstorageSourcePlugin = 'plugin';
|
|
|
const outstorageSourceDsAuto = 'ds_auto';
|
|
|
const outstorageSourceDsAutoUpdate = 'ds_auto_update';
|
|
|
|
|
|
const checkPurchaseStatusSourceQuick = 'quick';
|
|
|
const checkPurchaseStatusSourceAuto = 'auto';
|
|
|
|
|
|
const autoOutstorageActionStart = 'start';
|
|
|
const autoOutstorageActionEnd = 'end';
|
|
|
const autoOutstorageActionPullPurchaseOrderList = 'pullPurchaseOrderList';
|
|
|
const autoOutstorageActionCrawlPurchaseOrderInfo = 'crawlPurchaseOrderInfo';
|
|
|
const autoOutstorageActionUpdatePurchaseOrder = 'updatePurchaseOrder';
|
|
|
const autoOutstorageActionDoOutStorage = 'doOutStorage';
|
|
|
|
|
|
const autoOutstorageErrorCodeNone = 'none';
|
|
|
const autoOutstorageErrorCodeUnknown = 'unknown';
|
|
|
const autoOutstorageErrorCodeNoLogin = 'noLogin';
|
|
|
const autoOutstorageErrorCodeAccountNoOrder = 'accountNoOrder';
|
|
|
const autoOutstorageErrorCodeOutstorageFail = 'outstorageFail';
|
|
|
|
|
|
const purchaseOrderActionAutoRelate = 'auto_relate';
|
|
|
const purchaseOrderActionManualRelate = 'manual_relate';
|
|
|
const purchaseOrderActionUpdate = 'update';
|
|
|
const purchaseOrderActionRelateCancel = 'relate_cancel';
|
|
|
const purchaseOrderActionRelateCancelItem = 'relate_cancel_item';
|
|
|
const purchaseOrderActionManualCancel = 'manual_cancel';
|
|
|
const purchaseOrderActionManualCancelItem = 'manual_cancel_item';
|
|
|
|
|
|
const orderChannelIsNotPurchase = 0;
|
|
|
const orderChannelPddInnerPurchase = 1;
|
|
|
const orderChannelPddOutPurchase = 2;
|
|
|
|
|
|
const purchaseOrderCancelSourceManualCancel = 'manual_cancel';
|
|
|
const purchaseOrderCancelSourceManualRelate = 'manual_relate';
|
|
|
const purchaseOrderCancelSourceRelateCancel = 'relate_cancel';
|
|
|
const purchaseOrderCancelSourceDsRelateCancel = 'ds_relate_cancel';
|
|
|
const purchaseOrderCancelSourceDsCancel = 'ds_cancel';
|
|
|
const purchaseOrderCancelSourceDsMsgCancel = 'ds_msg_cancel';
|
|
|
const purchaseOrderCancelSourceDsCloseCancel = 'ds_close_cancel';
|
|
|
const purchaseOrderCancelSourceDsRelate = 'ds_relate';
|
|
|
const purchaseOrderCancelSourcePluginRelate = 'plugin_relate';
|
|
|
const purchaseOrderCancelSourceCgRelate = 'cg_relate';
|
|
|
const purchaseOrderCancelSourceCgCancel = 'cg_cancel';
|
|
|
|
|
|
const orderHighLightTypeTitle = 'title';
|
|
|
const orderHighLightTypeGoodsId = 'goodsId';
|
|
|
const orderHighLightTypeItemNum = 'itemNum';
|
|
|
const orderHighLightTypeNote = 'orderNote';
|
|
|
const orderHighLightTypeRemark = 'orderRemark';
|
|
|
|
|
|
const orderProcessAreaTypeIsolation = 'isolation';
|
|
|
const orderProcessAreaTypeWarning = 'warning';
|
|
|
|
|
|
const searchTypeSearchByTitle = 'searchByTitle';
|
|
|
const searchTypeSearchByImage = 'searchByImage';
|
|
|
|
|
|
const deliveryTimeTypeRightNow = 'right_now';
|
|
|
const deliveryTimeTypeLogisticsAccept = 'logistics_accept';
|
|
|
const deliveryTimeTypeDisabled = 'disabled';
|
|
|
|
|
|
const forbidAutoPurchaseRemarkClose = 0;
|
|
|
const forbidAutoPurchaseRemarkWithKeywords = 1;
|
|
|
const forbidAutoPurchaseRemarkWithContent = 2;
|
|
|
|
|
|
const actionSourcePlatformDsAutoPurchaseSetting = 'platformDsAutoPurchaseSetting';
|
|
|
const actionSourcePcDsAutoPurchaseSetting = 'pcDsAutoPurchaseSetting';
|
|
|
const actionSourceMobileDsAutoPurchaseSetting = 'mobileDsAutoPurchaseSetting';
|
|
|
const actionSourceInitDsPurchaseSetting = 'initDsPurchaseSetting';
|
|
|
const actionSourcePlatformPurchaseSetting = 'platformPurchaseSetting';
|
|
|
|
|
|
const dsEncryptOrderTypeAllSeller = 'allSeller';
|
|
|
const dsEncryptOrderTypeSomeSeller = 'someSeller';
|
|
|
|
|
|
public static function getPurchaseUrlSourceName($sourceI) {
|
|
|
$map = [
|
|
|
PurchaseOrderConst::purchaseUrlSourceMove => '搬家货源',
|
|
|
PurchaseOrderConst::purchaseUrlSourceManual => '手动添加货源',
|
|
|
];
|
|
|
return $map[$sourceI];
|
|
|
}
|
|
|
|
|
|
public static function getDsAutoPurchaseSettingActionSources() {
|
|
|
return [
|
|
|
self::actionSourcePlatformDsAutoPurchaseSetting,
|
|
|
self::actionSourcePcDsAutoPurchaseSetting,
|
|
|
self::actionSourceMobileDsAutoPurchaseSetting,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function isDsAutoPurchaseSettingActionSource($actionSource) {
|
|
|
return in_array($actionSource, self::getDsAutoPurchaseSettingActionSources());
|
|
|
}
|
|
|
|
|
|
public static function getOperaSourceFromActionSource($actionSource) {
|
|
|
$operaSource = '';
|
|
|
switch ($actionSource) {
|
|
|
case self::actionSourcePlatformDsAutoPurchaseSetting:
|
|
|
$operaSource = 'platform';
|
|
|
break;
|
|
|
case self::actionSourcePcDsAutoPurchaseSetting:
|
|
|
$operaSource = 'pc';
|
|
|
break;
|
|
|
case self::actionSourceMobileDsAutoPurchaseSetting:
|
|
|
$operaSource = 'mobile';
|
|
|
break;
|
|
|
}
|
|
|
return $operaSource;
|
|
|
}
|
|
|
|
|
|
public static function getSameReceiveInfoTipFieldNameMap() {
|
|
|
return [
|
|
|
PurchaseOrderConst::sameReceiveInfoTipFieldReceiverName => '收件人',
|
|
|
PurchaseOrderConst::sameReceiveInfoTipFieldReceiverPhone => '手机号',
|
|
|
PurchaseOrderConst::sameReceiveInfoTipFieldReceiverAddress => '收货地址',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
const autoFillRemarkTypeNone = '0';
|
|
|
const autoFillRemarkTypeOnlyOrderRemark = '1';
|
|
|
const autoFillRemarkTypeIncludeMallRemark = '2';
|
|
|
const autoFillRemarkTypeCustomRemark = '3';
|
|
|
const autoFillRemarkTypeSku = '4';
|
|
|
const autoFillRemarkTypeAddress = '5';
|
|
|
const autoFillRemarkTypeOnlyMallRemark = '6';
|
|
|
const autoFillRemarkTypePlatformName = '11';
|
|
|
const autoFillRemarkTypePlatformShopName = '12';
|
|
|
const autoFillRemarkTypePlatformOrderId = '13';
|
|
|
|
|
|
const autoFillOrderMemoTypeShopName = 'shop_name';
|
|
|
const autoFillOrderMemoTypeOrderId = 'order_id';
|
|
|
const autoFillOrderMemoTypeOrderRemark = 'order_remark';
|
|
|
const autoFillOrderMemoTypeSellerRemark = 'seller_remark';
|
|
|
const autoFillOrderMemoTypePlatformName = 'platform_name';
|
|
|
|
|
|
const currentPurchaseSettingVersion = 2;
|
|
|
|
|
|
public static function getPurchasePlatformAndOrderDsTblMap() {
|
|
|
return [
|
|
|
self::purchasePlatform1688DS => TblConst::op_order_ds,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getOrderDsTblByPurchasePlatform($purchasePlatform) {
|
|
|
return self::getPurchasePlatformAndOrderDsTblMap()[$purchasePlatform];
|
|
|
}
|
|
|
|
|
|
public static function getDsPurchasePlatforms() {
|
|
|
return array_keys(self::getPurchasePlatformAndOrderDsTblMap());
|
|
|
}
|
|
|
|
|
|
public static function getPurchasePlatformArray() {
|
|
|
return array(
|
|
|
self::purchasePlatformTaobao,
|
|
|
self::purchasePlatformPdd,
|
|
|
self::purchasePlatformTmall,
|
|
|
self::purchasePlatform1688,
|
|
|
self::purchasePlatformJd,
|
|
|
self::purchasePlatformWsy,
|
|
|
self::purchasePlatformSooxie,
|
|
|
self::purchasePlatformVvic,
|
|
|
self::purchasePlatform17qcc,
|
|
|
self::purchasePlatformZhe800,
|
|
|
self::purchasePlatform17zwd,
|
|
|
self::purchasePlatformHznzcn,
|
|
|
self::purchasePlatformBao66,
|
|
|
self::purchasePlatformK3,
|
|
|
self::purchasePlatformXingfujie,
|
|
|
self::purchasePlatform2tong,
|
|
|
self::purchasePlatformJuyi5,
|
|
|
self::purchasePlatform3e,
|
|
|
self::purchasePlatformKongfz,
|
|
|
self::purchasePlatformFzyj0591,
|
|
|
self::purchasePlatformJp0663,
|
|
|
self::purchasePlatform52dsy,
|
|
|
self::purchasePlatformTaote,
|
|
|
self::purchasePlatform91fj,
|
|
|
self::purchasePlatformYoupizhijia,
|
|
|
);
|
|
|
}
|
|
|
|
|
|
public static function getPurchasePlatformMap() {
|
|
|
$platformMap = array(
|
|
|
self::purchasePlatformTaobao => '淘宝',
|
|
|
self::purchasePlatformPdd => '拼多多',
|
|
|
self::purchasePlatformTmall => '天猫',
|
|
|
self::purchasePlatform1688 => '1688',
|
|
|
self::purchasePlatformJd => '京东',
|
|
|
self::purchasePlatformWsy => '网商园',
|
|
|
self::purchasePlatformSooxie => '搜鞋网',
|
|
|
self::purchasePlatformVvic => '搜款网',
|
|
|
self::purchasePlatform17qcc => '青创网',
|
|
|
self::purchasePlatformZhe800 => '折800',
|
|
|
self::purchasePlatform17zwd => '一起做网店',
|
|
|
self::purchasePlatformHznzcn => '杭州女装网',
|
|
|
self::purchasePlatformBao66 => '包牛牛',
|
|
|
self::purchasePlatformK3 => '开山网',
|
|
|
self::purchasePlatformXingfujie => '新款网',
|
|
|
self::purchasePlatform2tong => '二童网',
|
|
|
self::purchasePlatformJuyi5 => '聚衣网',
|
|
|
self::purchasePlatform3e => '生意网',
|
|
|
self::purchasePlatformKongfz => '孔夫子旧书网',
|
|
|
self::purchasePlatformFzyj0591 => '宇教网',
|
|
|
self::purchasePlatformOther => '其他平台',
|
|
|
self::purchasePlatform1688DS => '1688分销',
|
|
|
self::purchasePlatformJp0663 => '军埔网',
|
|
|
self::purchasePlatform52dsy => '52电商园',
|
|
|
self::purchasePlatformTaote => '淘特',
|
|
|
self::purchasePlatform91fj => '91家纺网',
|
|
|
self::purchasePlatformYoupizhijia => '优批之家',
|
|
|
);
|
|
|
|
|
|
return $platformMap;
|
|
|
}
|
|
|
|
|
|
public static function getPurchasePlatformName($purchasePlatform) {
|
|
|
$purchasePlatformMap = self::getPurchasePlatformMap();
|
|
|
|
|
|
return $purchasePlatformMap[$purchasePlatform];
|
|
|
}
|
|
|
|
|
|
public static function getPurchasePlatformLoginUrlMap() {
|
|
|
return [
|
|
|
self::purchasePlatform1688 => 'https://login.1688.com/member/signin.htm',
|
|
|
self::purchasePlatformTaobao => 'https://login.taobao.com/member/login.jhtml',
|
|
|
self::purchasePlatformPdd => 'http://mobile.yangkeduo.com/login.html',
|
|
|
self::purchasePlatformTmall => 'https://login.tmall.com',
|
|
|
self::purchasePlatformJd => 'https://passport.jd.com/uc/login',
|
|
|
self::purchasePlatformWsy => 'http://www.wsy.com/member/login.htm',
|
|
|
self::purchasePlatformSooxie => 'https://www.sooxie.com/',
|
|
|
self::purchasePlatformVvic => 'https://www.vvic.com/login.html',
|
|
|
self::purchasePlatform17qcc => 'https://www.17qcc.com/login.html',
|
|
|
self::purchasePlatformZhe800 => 'https://www.zhe800.com/login',
|
|
|
self::purchasePlatform17zwd => 'https://pp.17zwd.com/login',
|
|
|
self::purchasePlatformHznzcn => 'https://www.hznzcn.com/membercenter/login.html',
|
|
|
self::purchasePlatformBao66 => 'https://passport.bao66.cn/user/login',
|
|
|
self::purchasePlatformK3 => 'http://passport.k3.cn/user/login',
|
|
|
self::purchasePlatformXingfujie => 'https://passport.xingfujie.cn/user/login',
|
|
|
self::purchasePlatform2tong => 'https://passport.2tong.cn/user/login',
|
|
|
self::purchasePlatformJuyi5 => 'https://passport.juyi5.cn/user/login',
|
|
|
self::purchasePlatform3e => 'http://passport.3e3e.cn',
|
|
|
self::purchasePlatformKongfz => 'https://login.kongfz.com/?mustLogin=1',
|
|
|
self::purchasePlatformFzyj0591 => 'http://sc.fzyj0591.com/user.php',
|
|
|
self::purchasePlatformJp0663 => 'https://www.jp0663.com/login.html',
|
|
|
self::purchasePlatform52dsy => 'https://www.52dsy.com/user/login.html',
|
|
|
self::purchasePlatformYoupizhijia => 'https://www.youpizhijia.com/#/login',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getPurchasePlatformLoginUrl($purchasePlatform) {
|
|
|
$urlMpa = self::getPurchasePlatformLoginUrlMap();
|
|
|
return $urlMpa[$purchasePlatform];
|
|
|
}
|
|
|
|
|
|
public static function getShortPurchasePlatformMap() {
|
|
|
return array(
|
|
|
self::purchasePlatformTaobao => 'TB',
|
|
|
self::purchasePlatformPdd => 'PDD',
|
|
|
self::purchasePlatformTmall => 'TM',
|
|
|
self::purchasePlatform1688 => '1688',
|
|
|
self::purchasePlatformJd => 'JD',
|
|
|
self::purchasePlatform17qcc => '17QCC',
|
|
|
self::purchasePlatform17zwd => '17ZWD',
|
|
|
self::purchasePlatformHznzcn => 'HZNZCN',
|
|
|
self::purchasePlatformBao66 => 'BAO66',
|
|
|
self::purchasePlatformK3 => 'K3',
|
|
|
self::purchasePlatformXingfujie => 'XINGFUJIE',
|
|
|
self::purchasePlatform2tong => '2TONG',
|
|
|
self::purchasePlatformJuyi5 => 'JUYI5',
|
|
|
self::purchasePlatform1688DS => '1688DS',
|
|
|
self::purchasePlatformJp0663 => 'JP0663',
|
|
|
self::purchasePlatform52dsy => '52DSY',
|
|
|
self::purchasePlatformTaote => 'TAOTE',
|
|
|
self::purchasePlatform91fj => '91JF',
|
|
|
self::purchasePlatformYoupizhijia => 'YPZJ',
|
|
|
);
|
|
|
}
|
|
|
|
|
|
public static function getShortPurchasePlatformName($purchasePlatform) {
|
|
|
$purchasePlatformMap = self::getShortPurchasePlatformMap();
|
|
|
|
|
|
return $purchasePlatformMap[$purchasePlatform];
|
|
|
}
|
|
|
|
|
|
public static function getDefaultAppendMallRemarkFields() {
|
|
|
return array(
|
|
|
self::purchasePlatformField,
|
|
|
self::logisticsInfoField,
|
|
|
self::purchaseOrderBuyer,
|
|
|
);
|
|
|
}
|
|
|
|
|
|
public static function getPurchaseOrderDetailLink($purchasePlatform, $purchaseOrderSn) {
|
|
|
$orderDetailLink = '';
|
|
|
switch ($purchasePlatform) {
|
|
|
case self::purchasePlatformTaobao:
|
|
|
$orderDetailLink = "https://trade.taobao.com/trade/detail/trade_order_detail.htm?biz_order_id={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatformTmall:
|
|
|
$orderDetailLink = "https://trade.tmall.com/detail/orderDetail.htm?bizOrderId={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatformPdd:
|
|
|
$orderDetailLink = "https://mobile.yangkeduo.com/order.html?order_sn={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatformJd:
|
|
|
$orderDetailLink = "https://order.jd.com/center/search.action?keyword={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatform1688:
|
|
|
case self::purchasePlatform1688DS:
|
|
|
$orderDetailLink = "https://trade.1688.com/order/new_step_order_detail.htm?amug_web_biz=fwmkt&amug_web_fl_src=cy&orderId={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatformWsy:
|
|
|
$orderDetailLink = "https://www.wsy.com/member/wsyorderDetail.htm?orderid={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatform17qcc:
|
|
|
$orderDetailLink = "https://work.17qcc.com/buyer/trades/detail?tradeno={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatform17zwd:
|
|
|
$orderDetailLink = "https://daifa-new.17zwd.com/myorder/order/detail/{$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatformBao66:
|
|
|
$orderDetailLink = "http://bao66df.shoumanwu.com.cn/seller/order_list?state=&start_time=&end_time=&keywords={$purchaseOrderSn}&is_search=yes";
|
|
|
break;
|
|
|
case self::purchasePlatformK3:
|
|
|
$orderDetailLink = "http://k3df.shoumanwu.com.cn/seller/order_list?state=&start_time=&end_time=&keywords={$purchaseOrderSn}&is_search=yes";
|
|
|
break;
|
|
|
case self::purchasePlatformXingfujie:
|
|
|
$orderDetailLink = "http://xingfujiedf.shoumanwu.com.cn/seller/order_list?state=&start_time=&end_time=&keywords={$purchaseOrderSn}&is_search=yes";
|
|
|
break;
|
|
|
case self::purchasePlatform2tong:
|
|
|
$orderDetailLink = "http://2tongdf.shoumanwu.com.cn/seller/order_list?state=&start_time=&end_time=&keywords={$purchaseOrderSn}&is_search=yes";
|
|
|
break;
|
|
|
case self::purchasePlatformJuyi5:
|
|
|
$orderDetailLink = "http://juyi5df.shoumanwu.com.cn/seller/order_list?state=&start_time=&end_time=&keywords={$purchaseOrderSn}&is_search=yes";
|
|
|
break;
|
|
|
case self::purchasePlatformVvic:
|
|
|
$orderDetailLink = 'https://www.vvic.com/user/orders.html?vvic=reload&q=' . $purchaseOrderSn;
|
|
|
break;
|
|
|
case self::purchasePlatform3e:
|
|
|
$orderDetailLink = "http://3e3e.gsb68.com/purchaser/dropshipping/index?menu_id=order_dropShip&searchString={$purchaseOrderSn}";
|
|
|
break;
|
|
|
case self::purchasePlatformKongfz:
|
|
|
$orderDetailLink = 'http://shop.kongfz.com/buyer/order/order_detail.html?orderId=' . $purchaseOrderSn;
|
|
|
break;
|
|
|
case self::purchasePlatformSooxie:
|
|
|
$orderDetailLink = 'https://sooxie.com/u/orderInfo.aspx?id=' . $purchaseOrderSn;
|
|
|
break;
|
|
|
case self::purchasePlatformJp0663:
|
|
|
$orderDetailLink = 'https://www.jp0663.com/daifa.html?leixing=8';
|
|
|
break;
|
|
|
case self::purchasePlatform52dsy:
|
|
|
$orderDetailLink = 'https://www.52dsy.com/page/#/order/order_list';
|
|
|
break;
|
|
|
case self::purchasePlatformTaote:
|
|
|
$orderDetailLink = 'https://market.m.taobao.com/app/dinamic/h5-tb-odetail/index.html?archive=false&isNew=true&hideRecommend=true&hideWechatTools=true&bizOrderId=' . $purchaseOrderSn;
|
|
|
break;
|
|
|
case self::purchasePlatform91fj:
|
|
|
$orderDetailLink = 'https://www.91jf.com/default.php?url=member&act=order&pay_sn=' . $purchaseOrderSn;
|
|
|
break;
|
|
|
case self::purchasePlatformYoupizhijia:
|
|
|
$orderDetailLink = 'https://www.youpizhijia.com/#/admin/home/userOrder';
|
|
|
break;
|
|
|
}
|
|
|
return $orderDetailLink;
|
|
|
}
|
|
|
|
|
|
public static function getHasPlatformOrderDetailIdPurchasePlatformList()
|
|
|
{
|
|
|
return [self::purchasePlatformHznzcn, self::purchasePlatformFzyj0591, self::purchasePlatformYoupizhijia];
|
|
|
}
|
|
|
|
|
|
public static function getPlatformOrderUrlNeedPlatformOrderDetailIdPurchasePlatformList()
|
|
|
{
|
|
|
return [self::purchasePlatformHznzcn, self::purchasePlatformFzyj0591, self::purchasePlatformYoupizhijia];
|
|
|
}
|
|
|
|
|
|
public static function getPurchaseOrderUrl($purchasePlatform, $purchaseOrderSn, $purchaseOrderStatus, $orderDetailId, $wsyOrderType, $platformOrderDetailId = null) {
|
|
|
if (CommonTool::anyEmpty($purchasePlatform, $purchaseOrderSn, $purchaseOrderStatus)) {
|
|
|
return '';
|
|
|
}
|
|
|
if ($purchasePlatform == self::purchasePlatformWsy) {
|
|
|
return self::getWsyPlatformOrderUrl($orderDetailId, $wsyOrderType);
|
|
|
}
|
|
|
|
|
|
$platformOrderDetailIdPlatforms = self::getPlatformOrderUrlNeedPlatformOrderDetailIdPurchasePlatformList();
|
|
|
if (in_array($purchasePlatform, $platformOrderDetailIdPlatforms)) {
|
|
|
$orderDetailUrl = self::getPurchaseOrderDetailUrlByOrderDetailId($purchasePlatform, $platformOrderDetailId);
|
|
|
} else {
|
|
|
$orderDetailUrl = self::getPurchaseOrderDetailLink($purchasePlatform, $purchaseOrderSn);
|
|
|
}
|
|
|
return $orderDetailUrl;
|
|
|
}
|
|
|
|
|
|
public static function createPurchaseOrderRefundBtn($purchasePlatform, $purchaseOrderSn, $purchaseOrderStatus, $orderDetailId, $wsyOrderType, $purchaseOrderBuyer = '', $platformOrderDetailId = null) {
|
|
|
if (CommonTool::anyEmpty($purchasePlatform, $purchaseOrderSn, $purchaseOrderStatus)) {
|
|
|
return '';
|
|
|
}
|
|
|
if (in_array($purchaseOrderStatus, [self::purchaseOrderStatusRefund, self::purchaseOrderStatusCancel])) {
|
|
|
return '';
|
|
|
}
|
|
|
if ($purchasePlatform == self::purchasePlatformWsy) {
|
|
|
$wsyOrderDetailUrl = self::getWsyPlatformOrderUrl($orderDetailId, $wsyOrderType);
|
|
|
if (empty($wsyOrderDetailUrl)) {
|
|
|
return '';
|
|
|
}
|
|
|
return '<a href="' . $wsyOrderDetailUrl . '" target="_blank" class="label label-danger ml_5 J_openPurchasePlatformWindow" dt-purchase-account="'.$purchaseOrderBuyer.'" dt-purchase-platform="' . $purchasePlatform . '">申请退款</a>';
|
|
|
}
|
|
|
|
|
|
$platformOrderDetailIdPlatforms = [self::purchasePlatformHznzcn, self::purchasePlatformYoupizhijia];
|
|
|
if (in_array($purchasePlatform, $platformOrderDetailIdPlatforms)) {
|
|
|
$refundLink = self::getPurchaseOrderDetailUrlByOrderDetailId($purchasePlatform, $platformOrderDetailId);
|
|
|
} else {
|
|
|
$refundLink = self::getPurchaseOrderDetailLink($purchasePlatform, $purchaseOrderSn);
|
|
|
}
|
|
|
|
|
|
if (empty($refundLink)) {
|
|
|
return '';
|
|
|
}
|
|
|
return '<a href="' . $refundLink . '" target="_blank" class="label label-danger ml_5 J_openPurchasePlatformWindow" dt-purchase-account="'.$purchaseOrderBuyer.'" dt-purchase-platform="' . $purchasePlatform . '">申请退款</a>';
|
|
|
}
|
|
|
|
|
|
public static function getPurchaseOrderDetailUrlByOrderDetailId($purchasePlatform, $orderDetailId) {
|
|
|
$url = false;
|
|
|
|
|
|
switch ($purchasePlatform) {
|
|
|
case self::purchasePlatformHznzcn:
|
|
|
$url = 'https://www.hznzcn.com/order/order_detail?orderId=' . $orderDetailId;
|
|
|
break;
|
|
|
case self::purchasePlatformFzyj0591:
|
|
|
$url = 'http://sc.fzyj0591.com/user.php?act=order_detail&order_id=' . $orderDetailId;
|
|
|
break;
|
|
|
case self::purchasePlatformYoupizhijia:
|
|
|
$url = 'https://www.youpizhijia.com/#/admin/orderInfo/' . $orderDetailId;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
return $url;
|
|
|
}
|
|
|
|
|
|
public static function getWsyPlatformOrderUrl($orderDetailId, $wsyOrderType) {
|
|
|
if (CommonTool::anyEmpty($orderDetailId, $wsyOrderType)) {
|
|
|
return '';
|
|
|
}
|
|
|
$orderDetailUrl = '';
|
|
|
if ($wsyOrderType == 'wsyPlatform') {
|
|
|
$orderDetailUrl = 'http://www.wsy.com/member/wsyorderDetail.htm?orderid=' . $orderDetailId;
|
|
|
} elseif ($wsyOrderType == 'wsyShop') {
|
|
|
$orderDetailUrl = 'http://www.wsy.com/member/order_goods.php?id=' . $orderDetailId;
|
|
|
}
|
|
|
return $orderDetailUrl;
|
|
|
}
|
|
|
|
|
|
public static function getOrderStatusMaps() {
|
|
|
return [
|
|
|
PurchaseOrderConst::purchaseOrderStatusWaitPay => '待付款',
|
|
|
PurchaseOrderConst::purchaseOrderStatusWaitSend => '待发货',
|
|
|
PurchaseOrderConst::purchaseOrderStatusHasSend => '待收货',
|
|
|
PurchaseOrderConst::purchaseOrderStatusFinished => '交易成功',
|
|
|
PurchaseOrderConst::purchaseOrderStatusCancel => '交易关闭',
|
|
|
PurchaseOrderConst::purchaseOrderStatusRefund => '退款中',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getSearchSameGoodsTypeAndNameMap() {
|
|
|
return [
|
|
|
self::searchTypeSearchByTitle => '搜标题同款',
|
|
|
self::searchTypeSearchByImage => '搜图片同款',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getSearchSameGoodsHtmlByType($type, $name, $title, $skuImgUrl) {
|
|
|
$searchSamePlatformList = self::getSearchSamePlatformList();
|
|
|
$html = '<div class="search-same-goods"><ul >';
|
|
|
foreach ($searchSamePlatformList as $searchSamePlatform) {
|
|
|
if (!in_array($type, $searchSamePlatform['searchTypes'])) {
|
|
|
continue;
|
|
|
}
|
|
|
$html .= '<li class="J_beforeSearchSameGoods"
|
|
|
data-search-type="' . $type . '"
|
|
|
data-search-image-url="' . $skuImgUrl . '"
|
|
|
data-search-platform="' . $searchSamePlatform['platform'] . '"
|
|
|
data-same-item-url="' . $searchSamePlatform['sameItemUrl'] . '"
|
|
|
data-search-title="' . $title . '">
|
|
|
<img src="' . $searchSamePlatform['logo'] . '" alt="' . $searchSamePlatform['platform'] . '">
|
|
|
<span> ' . self::getPurchasePlatformName($searchSamePlatform['platform']) . ' '. $name . '</span>
|
|
|
</li>';
|
|
|
}
|
|
|
$html .= '</ul></div>';
|
|
|
|
|
|
return $html;
|
|
|
}
|
|
|
|
|
|
public static function getSearchSamePlatformList() {
|
|
|
return [
|
|
|
//淘宝pc端搜图片功能下架了,暂时先注释掉,以后支持了再放出来
|
|
|
[
|
|
|
'platform' => self::purchasePlatformTaote,
|
|
|
'logo' => '/app/views/static_ext/img/platform_icons/taote.png',
|
|
|
'sameItemUrl' => '',
|
|
|
'searchTypes' => [self::searchTypeSearchByImage],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformTaobao,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/taobao.png',
|
|
|
'sameItemUrl' => 'https://s.taobao.com/search?q=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformTmall,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/tmall.png',
|
|
|
'sameItemUrl' => 'https://list.tmall.com/search_product.htm?q=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatform1688,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/1688.png',
|
|
|
'sameItemUrl' => 'https://s.1688.com/selloffer/offer_search.htm?charset=utf8&keywords=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle, self::searchTypeSearchByImage],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformJd,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/jd.png',
|
|
|
'sameItemUrl' => 'https://search.jd.com/Search?enc=utf-8&keyword=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle, self::searchTypeSearchByImage],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformPdd,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/yangkeduo.png',
|
|
|
'sameItemUrl' => 'https://mobile.yangkeduo.com/search_result.html?search_key=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformWsy,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/wsy.png',
|
|
|
'sameItemUrl' => 'https://www.wsy.com/search.htm?accurate=&search_type=item&q=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle, self::searchTypeSearchByImage],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatform17qcc,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/17qcc.png',
|
|
|
'sameItemUrl' => 'https://www.17qcc.com/list.html?keyword=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformSooxie,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/sooxie.png',
|
|
|
'sameItemUrl' => 'https://www.sooxie.com/default.aspx?s=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle, self::searchTypeSearchByImage],
|
|
|
],
|
|
|
[
|
|
|
'platform' => self::purchasePlatformVvic,
|
|
|
'logo' => 'http://pub.chengji-inc.com/static_common/image/shop/vvic.png',
|
|
|
'sameItemUrl' => 'https://www.vvic.com/gz/search/index.html?q=',
|
|
|
'searchTypes' => [self::searchTypeSearchByTitle, self::searchTypeSearchByImage],
|
|
|
],
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getPurchaseFixedMobileColumnByPurchasePlatform($purchasePlatform) {
|
|
|
return 'purchase_pdd_fixed_mobile';
|
|
|
}
|
|
|
|
|
|
public static function getSupportSearchSameGoodPlatformMap() {
|
|
|
return [
|
|
|
PurchaseOrderConst::purchasePlatformTaote => '淘特',
|
|
|
PurchaseOrderConst::purchasePlatform1688 => '1688',
|
|
|
PurchaseOrderConst::purchasePlatformYiwugou => '义乌购',
|
|
|
PurchaseOrderConst::purchasePlatform17zwd => '17做网店',
|
|
|
PurchaseOrderConst::purchasePlatformWsy => '网商园',
|
|
|
];
|
|
|
}
|
|
|
|
|
|
public static function getPurchaseFixedMobilePlatformMap() {
|
|
|
return [
|
|
|
PurchaseOrderConst::purchasePlatformPdd => '拼多多',
|
|
|
PurchaseOrderConst::purchasePlatformTaobao => '淘宝',
|
|
|
PurchaseOrderConst::purchasePlatformTmall => '天猫',
|
|
|
];
|
|
|
}
|
|
|
} |