修改采购价格录入限制

This commit is contained in:
lewis 2025-04-14 14:44:25 +08:00
parent e6e0eaadab
commit daf4b858ce

View File

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