Compare commits

...

2 Commits

Author SHA1 Message Date
d71b3ddefa Merge pull request '修改采购价格录入的错误' (#7) from dev into main
Reviewed-on: #7
2025-04-06 10:35:44 +08:00
850773a2fd 修改采购价格录入的错误 2025-04-06 10:33:06 +08:00

View File

@ -217,7 +217,7 @@ class PurchaseProductOfferLogic extends BaseLogic
$offer = PurchaseProductOffer::where(['id' => $params['id']])->find();
$lastPrice = PurchaseProductOffer::where(['product_id' => $offer['product_id']])->where('status', 1)->order('id desc')->value('price');
$currentPrice = bcdiv($params['total_price'], $params['buyer_nums'], 2);
if (!empty($lastPrice) && ($currentPrice > $lastPrice * 3 || $currentPrice < $lastPrice / 3)) {
if ($lastPrice > 0 && ($currentPrice > $lastPrice * 3 || $currentPrice < $lastPrice / 3)) {
throw new BusinessException('价格异常,请重新输入');
}
// $uid=Admin::where('id',$params['admin_id'])->value('uid');