From 817a2a441edfbc7c53a33c5b506526761bbbb670 Mon Sep 17 00:00:00 2001 From: limu Date: Fri, 29 Dec 2023 16:57:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=BB=E8=8E=B7=E5=88=A9=E5=A5=96=E9=87=91?= =?UTF-8?q?=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/jobs/OrderPartnerJob.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crmeb/jobs/OrderPartnerJob.php b/crmeb/jobs/OrderPartnerJob.php index eebe651..67cb596 100644 --- a/crmeb/jobs/OrderPartnerJob.php +++ b/crmeb/jobs/OrderPartnerJob.php @@ -13,6 +13,7 @@ namespace crmeb\jobs; +use app\common\model\system\config\SystemConfig; use crmeb\interfaces\JobInterface; use think\Exception; use think\facade\Log; @@ -99,6 +100,12 @@ class OrderPartnerJob implements JobInterface throw new Exception('订单没有指定三种类型商品,不计入贡献值统计'); } + //将总毛利的70% 计入总奖池 + $all_value = bcmul($total_price, '0.7', 2); + $system = SystemConfig::getDB()->where('config_key', 'all_award')->find(); + $system->value = $system->value + $all_value; + $system->save(); + //读取品牌所属分类 if (!empty($brand_ids)) { $brand_ids = array_unique($brand_ids);