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.
pdd-order-api/app/libs/const/class.BatchConst.php

258 lines
9.3 KiB
PHP

<?php
class BatchConst {
const batchFieldIsPreSale = 'batchFieldIsPreSale';
const batchFieldPreSaleTime = 'batchFieldPreSaleTime';
const batchFieldSecondHand = 'batchFieldSecondHand';
const batchFieldShipmentLimitSecond = 'batchFieldShipmentLimitSecond';
const batchFieldIsRefundable = 'batchFieldIsRefundable';
const batchFieldIsFolt = 'batchFieldIsFolt';
const batchFieldCountryId = 'batchFieldCountryId';
const wareDetectTaskTypeWord = 'word';
const wareDetectTaskTypeAttr = 'attr';
const batchUploadOssFail = 'fail';
const batchEnableYes = 'yes';
const batchEnableNot = 'not';
const batchCateAttrsUpdateSkip = '`_ms_skip`';
const batchCateAttrsUpdateClear = '`_ms_clear`';
const batchBoolTrue = 1;
const batchBoolFalse = 0;
const batchTypePrice = 'price'; //京东价
const batchTypeMultiPrice = 'multi_price'; //团购价
const batchTypeMarketPrice = 'market_price'; //市场价
const batchTypeCostPrice = 'cost_price'; //进货价
const batchTypeBrandId = 'brand_id'; //品牌
const batchTypeTransportId = 'transport_id'; //运费模板
const batchTypeIsOnsale = 'is_onsale'; //上下架
const batchTypeGoodsDelete = 'goods_delete'; //删除
const batchTypeTimerGoodsStatus = 'timer_is_onsale'; //定时上下架
const batchTypeShopCategory = 'shop_category'; //自定义店内分类
const batchTypeStock = 'stock'; //库存数
const batchTypeIsPreSale = 'is_pre_sale'; // 商品预售时间
const batchTypeImportItemNum = 'item_num'; //货号
const batchTypeOutGoodsId = 'out_goods_id'; //商家编码
const batchTypeOutSkuSn = 'out_sku_sn'; //SKU商家编码
const batchTypeSizeWeight = 'size_weight'; //尺寸与重量
const batchTypeAreaLimit = 'area_limit'; //区域限制
const batchTypeDescription = 'desc'; //描述
const batchTypeCateAttr = 'cate_attr'; //商品属性
const batchTypeAcrossCateAttr = 'across_cate_attr'; //商品属性
const batchTypeMoveCategory = 'move_category'; //类目迁移
const batchTypeService = 'service'; //售后服务
const batchTypePackListing = 'pack_listing'; //包装清单
const batchTypeOther = 'other'; //其它商品信息
const batchTypeUpcCode = 'upcCode'; //upc编码
const batchTypeImage = 'image';
const batchTypeGoodsLocation = 'goods_location'; //产地
const batchTypeCps = 'cps'; //多多进宝商品推广
const batchTypeIsCanVat = 'is_can_vat'; //发票限制
const batchTypeIsPayFirst = 'is_pay_first'; //是否先款后货
const batchTypeAdContent = 'ad_content'; //广告词
const batchTypeTitle = 'title'; //标题
const batchTypeTinyName = 'tiny_name'; //短标题
const batchTypeItemNumModify = 'item_num_modify'; //批量修改货号
const batchTypeAlias = 'alias';
const batchTypeDelivery = 'delivery'; //批量设置发货地
const batchTypeCountry = 'country'; //批量设置货源地
const batchTypeDeliveryType = 'delivery_type'; //批量设置物流类型
const batchTypeAllSpu = 'all_spu'; // 商品SPU信息
const batchTypeAllSku = 'all_sku'; // sku信息
const batchChooseTypeRange = 'range';
const batchChooseTypeGoods = 'goods';
const batchChooseTypeGoodsIds = 'goodsIds';
const batchChooseTypeItemNums = 'itemNums';
const batchChooseTypeImport = 'import';
const batchSearchItemTypeAccurate = 'accurate'; //精确搜索
const batchSearchItemTypePrefix = 'prefix'; //前缀搜索
const modifyModeClear = 'clear';
const separatorUnderline = 'underline';
const separatorLineThrough = 'lineThrough';
const separatorVerticalLine = 'verticalLine';
const separatorSpace = 'space';
const separatorNothing = 'nothing';
const chineseNoProcessing = "noProcessing";
const chineseFirstWord = "firstWord";
const searchSortFieldModified = 'modified';
const searchSortFieldOnlineTime = 'online_time';
const searchSortFieldOfflineTime = 'offline_time';
const selectRuleGoodsIdAndColorAndSize = 'goodsIdAndColorAndSize';
const selectRuleGoodsIdAndColorAndSizeNum = 'goodsIdAndColorAndSizeNum';
const selectRuleOuterGoodsIdAndColorAndSize = 'outerGoodsIdAndColorAndSize';
const selectRuleOuterGoodsIdAndColorAndSizeNum = 'outerGoodsIdAndColorAndSizeNum';
const selectRuleColorAndSize = 'colorAndSize';
const selectRuleColorAndSizeNum = 'colorAndSizeNum';
const selectRuleOuterGoodsIdAndNum = 'outerGoodsIdAndNum';
const itemNumIsEmptyOperateUseGoodsId = 'useGoodsId';
const itemNumIsEmptyOperateJumpGoods = 'jumpGoods';
const outerIdAddUseFieldGoodsId = 'goodsId';
const outerIdAddUseFieldOutGoodsId = 'outerGoodsId';
const outerIdAddUseFieldOutSkuSn = 'outSkuSn';
// http://open.pinduoduo.com/#/apidocument/port?id=17
const opTypeOnSale = 1;
const opTypeForSale = 0;
const taskMaxGoodsTotal = 120000; //任务最多允许提交商品数
const batchTaskQueueMaxCount = 3000;
const deleteGoodsOverDailyNum = 1000; // 拼多多每日删除商品上限
const inputGoodsIdsMaxCount = 200;
const inputItemNumsMaxCount = 200;
const batchAreaLimitGroupTypeVender = 'vender';
const batchAreaLimitGroupTypeSystem = 'system';
const needDeleteBatchTaskAfterDays = 60;
const goodsNameMaxLength = 60;
public static function getMallBatchTypeQueueLimit() {
return array(
BatchConst::batchTypeIsOnsale => 5,
BatchConst::batchTypeGoodsDelete => 10,
);
}
public static function getTaskMaxGoodsTotal() {
$goodsTotal = self::taskMaxGoodsTotal;
return $goodsTotal;
}
public static function getBatchTypeNameMap() {
return array(
self::batchTypeTitle => self::getBatchTypeName(self::batchTypeTitle),
self::batchTypeTinyName => self::getBatchTypeName(self::batchTypeTinyName),
self::batchTypePrice => self::getBatchTypeName(self::batchTypePrice),
self::batchTypeMultiPrice => self::getBatchTypeName(self::batchTypeMultiPrice),
self::batchTypeMarketPrice => self::getBatchTypeName(self::batchTypeMarketPrice),
self::batchTypeStock => self::getBatchTypeName(self::batchTypeStock),
self::batchTypeDescription => self::getBatchTypeName(self::batchTypeDescription),
self::batchTypeOther => self::getBatchTypeName(self::batchTypeOther),
self::batchTypeIsOnsale => self::getBatchTypeName(self::batchTypeIsOnsale),
);
}
public static function getBatchTypeName($type) {
switch ($type) {
case self::batchTypeTitle :
$batchTypeName = '批量修改标题';
break;
case self::batchTypeTinyName :
$batchTypeName = '批量修改短标题';
break;
case self::batchTypePrice :
$batchTypeName = '批量修改单买价';
break;
case self::batchTypeMultiPrice :
$batchTypeName = '批量修改团购价';
break;
case self::batchTypeMarketPrice :
$batchTypeName = '批量修市场价';
break;
case self::batchTypeStock :
$batchTypeName = '批量修改库存';
break;
case self::batchTypeDescription :
$batchTypeName = '批量修改商品描述';
break;
case self::batchTypeOther :
$batchTypeName = '批量修其它商品信息';
break;
case self::batchTypeOutSkuSn :
$batchTypeName = '批量修改SKU商家编码';
break;
case self::batchTypeIsOnsale :
$batchTypeName = '批量修改上下架';
break;
case self::batchTypeIsPreSale :
$batchTypeName = '批量修改预售时间';
break;
case self::batchTypeGoodsDelete :
$batchTypeName = '批量删除商品';
break;
case self::batchTypeCps :
$batchTypeName = '多多进宝推广';
break;
case self::batchTypeBrandId :
$batchTypeName = '批量修改品牌';
break;
case self::batchTypeTransportId :
$batchTypeName = '批量修改运费模板';
break;
case self::batchTypeCateAttr :
$batchTypeName = '批量修改商品属性';
break;
case self::batchTypeAcrossCateAttr :
$batchTypeName = '批量修改跨类目属性';
break;
case self::batchTypeMoveCategory :
$batchTypeName = '批量类目迁移';
break;
case self::batchTypeImage :
$batchTypeName = '批量图片补全';
break;
case self::batchTypeAllSpu :
$batchTypeName = '导入修改商品';
break;
case self::batchTypeAllSku :
$batchTypeName = '导入修改商品SKU';
break;
case self::batchTypeCountry :
$batchTypeName = '批量修改商品货源地';
break;
case self::batchTypeDeliveryType :
$batchTypeName = '批量修改物流类型';
break;
default :
$batchTypeName = '';
}
return $batchTypeName;
}
public static function isOnlyAllowImportBatchType($batchType) {
$list = [
BatchConst::batchTypeAllSpu,
BatchConst::batchTypeAllSku,
];
return in_array($batchType, $list);
}
public static function isSupportMultiShop($batchType) {
if (!$batchType) {
return false;
}
$notAllowMultiShopTypes = array(
BatchConst::batchTypeTransportId,
BatchConst::batchTypeAcrossCateAttr,
BatchConst::batchTypeCountry,
BatchConst::batchTypeMoveCategory,
BatchConst::batchTypeAllSpu,
);
return !in_array($batchType, $notAllowMultiShopTypes);
}
}