调整商品毛利率计算
This commit is contained in:
parent
981d63ba98
commit
e5ae173ac6
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user