'搬家货源', 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 '申请退款'; } $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 '申请退款'; } 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 = '