修改采购价格录入的错误

This commit is contained in:
lewis 2025-04-06 10:33:06 +08:00
parent 8aa2740b50
commit 850773a2fd

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');