From e5ae173ac6734422315c11c7f8aa1ca3b2858e8a Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Mon, 26 Feb 2024 15:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=95=86=E5=93=81=E6=AF=9B?= =?UTF-8?q?=E5=88=A9=E7=8E=87=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/listens/SetProductProfitRateListen.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/listens/SetProductProfitRateListen.php b/crmeb/listens/SetProductProfitRateListen.php index be2c597c..b84c0a86 100644 --- a/crmeb/listens/SetProductProfitRateListen.php +++ b/crmeb/listens/SetProductProfitRateListen.php @@ -24,7 +24,7 @@ class SetProductProfitRateListen extends TimerService implements ListenerInterfa ->limit(100) ->select(); foreach ($storeProducts as $storeProduct) { - $storeProduct->profit_rate = bcdiv($storeProduct->procure_price, $storeProduct->price, 2) * 100; + $storeProduct->profit_rate = bcdiv(bcsub($storeProduct->price, $storeProduct->procure_price, 2), $storeProduct->price, 2) * 100; $storeProduct->save(); } } catch (\Throwable $e) {