Merge pull request 'fix: 产品赔偿费用无计算结果 fix #481' (#489) from fix_product_fee_count into @hera/dev

Reviewed-on: daoyoucloud/tachycode#489
Reviewed-by: sealday <zhanglin@daoyoucloud.com>
This commit is contained in:
sealday 2024-03-25 17:53:44 +08:00
commit 6d55556254
2 changed files with 6 additions and 6 deletions

View File

@ -100,9 +100,9 @@ export const RecordFeeConvertedAmount: CustomFunctionComponent = () => {
} else if (feeRule.conversion_logic_id === ConversionLogics.ProductWeight) {
calcValue = calcValue * productData.weight;
} else {
const weightItem = feeRule.conversion_logic?.weight_items.find((item) => {
item.product_id - 99999 === category.id || item.product_id === productData.id;
});
const weightItem = feeRule.conversion_logic?.weight_items.find(
(item) => item.product_id - 99999 === category.id || item.product_id === productData.id,
);
if (!weightItem) return;
if (weightItem.conversion_logic_id === ConversionLogics.Keep) {
calcValue = calcValue * weightItem.weight;

View File

@ -95,9 +95,9 @@ export const ReadFeeConvertedAmount: CustomFunctionComponent = () => {
} else if (feeRule.conversion_logic_id === ConversionLogics.ProductWeight) {
calcValue = calcValue * productData.weight;
} else {
const weightItem = feeRule.conversion_logic.weight_items.find((item) => {
item.product_id - 99999 === category.id || item.product_id === productData.id;
});
const weightItem = feeRule.conversion_logic.weight_items.find(
(item) => item.product_id - 99999 === category.id || item.product_id === productData.id,
);
if (!weightItem) return;
if (weightItem.conversion_logic_id === ConversionLogics.Keep) {
calcValue = calcValue * weightItem.weight;