修改采购价格录入的错误 #7

Merged
lewis merged 1 commits from dev into main 2025-04-06 10:35:45 +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');