Просмотр исходного кода

feat(product): 添加共富商品特殊处理逻辑

- 引入 CommonEnum 枚举类用于订单收益分配配置
- 为商户ID为3447的共富商品添加养老金额计算
- 设置共富商品的积分和贡献值为0
- 保持原有的PV、积分等字段赋值逻辑
shichen месяцев назад: 5
Родитель
Сommit
0459be63cc
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      app/common/repositories/store/product/ProductRepository.php

+ 7 - 1
app/common/repositories/store/product/ProductRepository.php

@@ -7,6 +7,7 @@
7 7
 
8 8
 namespace app\common\repositories\store\product;
9 9
 
10
+use app\common\enum\CommonEnum;
10 11
 use app\common\model\store\order\StoreOrder;
11 12
 use app\common\model\store\product\Product;
12 13
 use app\common\model\store\product\ProductContent;
@@ -1052,7 +1053,12 @@ class ProductRepository extends BaseRepository
1052 1053
         }
1053 1054
 
1054 1055
 
1055
-
1056
+        // 共富商品处理
1057
+        if ($res['mer_id'] == 3447) {
1058
+            $res['yanglao'] = bcmul($res['price'], CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], 2);
1059
+            $k['jifen'] = 0;
1060
+            $k['gongxian'] = 0;
1061
+        }
1056 1062
 
1057 1063
         $res['pv']=($k['pv']);
1058 1064
         $res['jifen']=($k['jifen']);