Browse Source

feat(product): 添加养老金计算功能

- 在产品仓库中增加针对商户ID为3447的特殊处理逻辑
- 实现产品SKU价格查询并按升序排列
- 集成养老金额度计算公式,基于价格和分配比例
- 添加对SharedProsperity模块中养老金比率的引用
- 扩展现有产品属性值表的数据查询功能
shichen 4 months ago
parent
commit
75cf0ac7b5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/common/repositories/store/product/ProductRepository.php

+ 3 - 0
app/common/repositories/store/product/ProductRepository.php

@@ -1849,6 +1849,9 @@ class ProductRepository extends BaseRepository
1849
                         3=>$product['price']//复购金
1849
                         3=>$product['price']//复购金
1850
                     ]
1850
                     ]
1851
                 ];
1851
                 ];
1852
+            } else if($product['mer_id'] == 3447){
1853
+                $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
1854
+                $yanglao = bcmul($productSku['price'], CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], 2);
1852
             } else {
1855
             } else {
1853
                 // 商贸区
1856
                 // 商贸区
1854
                 /** @var MerchantRepository $merchant */
1857
                 /** @var MerchantRepository $merchant */