|
@@ -15,6 +15,7 @@ use app\common\dao\system\merchant\MerchantDao;
|
|
15
|
use app\common\enum\CommonEnum;
|
15
|
use app\common\enum\CommonEnum;
|
|
16
|
use app\common\model\store\product\ProductReply;
|
16
|
use app\common\model\store\product\ProductReply;
|
|
17
|
use app\common\repositories\BaseRepository;
|
17
|
use app\common\repositories\BaseRepository;
|
|
|
|
18
|
+use app\common\repositories\shared\SharedProsperityRecommendConfigRepository;
|
|
18
|
use app\common\repositories\store\product\ProductCopyRepository;
|
19
|
use app\common\repositories\store\product\ProductCopyRepository;
|
|
19
|
use app\common\repositories\store\product\ProductRepository;
|
20
|
use app\common\repositories\store\product\ProductRepository;
|
|
20
|
use app\common\repositories\store\shipping\ShippingTemplateRepository;
|
21
|
use app\common\repositories\store\shipping\ShippingTemplateRepository;
|
|
@@ -505,6 +506,18 @@ class MerchantRepository extends BaseRepository
|
|
505
|
}else if ($productMerId == 3447) {
|
506
|
}else if ($productMerId == 3447) {
|
|
506
|
$yanglao = bcmul($v['price'], CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], 2);
|
507
|
$yanglao = bcmul($v['price'], CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], 2);
|
|
507
|
$v['yanglao'] = $yanglao;
|
508
|
$v['yanglao'] = $yanglao;
|
|
|
|
509
|
+
|
|
|
|
510
|
+ // 发放共富区PV
|
|
|
|
511
|
+ /** @var SharedProsperityRecommendConfigRepository $sharedProsperityRecommendConfigRepository */
|
|
|
|
512
|
+ $sharedProsperityRecommendConfigRepository = app()->make(SharedProsperityRecommendConfigRepository::class);
|
|
|
|
513
|
+ $sharedProsperityRecommendConfigEntityByMaxRewardRatio = $sharedProsperityRecommendConfigRepository->getSharedProsperityRecommendConfigEntityByMaxRewardRatio();
|
|
|
|
514
|
+ // 利润 减去 顶格的直推奖,剩下的是PV值
|
|
|
|
515
|
+ $pvProportion = bcsub('1', bcdiv($sharedProsperityRecommendConfigEntityByMaxRewardRatio->getRewardRatio(), '100', 4), 2);
|
|
|
|
516
|
+ // 获取利润
|
|
|
|
517
|
+ $productSku = Db::name('store_product_attr_value')->where('product_id', $v['product_id'])->order('price asc')->find();
|
|
|
|
518
|
+ // 计算pv
|
|
|
|
519
|
+ $pv = bcmul($productSku['plate_mer_profit'], $pvProportion, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
|
520
|
+ $v['pv'] = $pv;
|
|
508
|
}
|
521
|
}
|
|
509
|
|
522
|
|
|
510
|
// $v=($v,$k);
|
523
|
// $v=($v,$k);
|