|
|
@@ -438,10 +438,10 @@ class OwnerPriceOperationService
|
|
|
if ($result)$rule->unit_price = explode(",",$rule->discount_price)[key($result)]; //满足满减条件,单价调整为满减单价
|
|
|
|
|
|
if ($rule->strategy=='起步'){
|
|
|
- $money = $rule->unit_price;
|
|
|
$startNumber = $rule->amount;
|
|
|
- if ($unitName && $startNumber && $unitName != $units[$rule->unit_id])return -3; //校验单位是否一致
|
|
|
+ $money = $startNumber ? $startNumber*$rule->unit_price : $rule->unit_price;
|
|
|
|
|
|
+ if ($unitName && $startNumber && $unitName != $units[$rule->unit_id])return -3; //校验单位是否一致
|
|
|
if ($startNumber)$matchObject=$this->settingCount($matchObject,$columnMapping[8],$startNumber);
|
|
|
if ($matchObject)foreach ($matchObject as $package)$money += $package[$columnMapping[8]] * $package["price"];
|
|
|
if (!$startNumber && $money<$rule->unit_price)$money = $rule->unit_price;
|
|
|
@@ -487,6 +487,10 @@ class OwnerPriceOperationService
|
|
|
if ($package[$amountColumn] <= 0){
|
|
|
unset($packages[$i]);continue;
|
|
|
}
|
|
|
+ if (!($package["price"] ?? false)){
|
|
|
+ $package["price"] = 0;
|
|
|
+ $packages[$i]["price"] = 0;
|
|
|
+ }
|
|
|
if ($package["price"] > $maxPrice || ($package["price"]==0 && $maxPrice==0)){
|
|
|
$maxPrice = $package["price"];
|
|
|
$index = $i;
|