|
|
@@ -254,7 +254,7 @@ class ShMethodClass extends BaseClass
|
|
|
$unMeetFee = isset($config['unMeetFee']) ? (float)$config['unMeetFee'] : 0;
|
|
|
|
|
|
// 不满最低消费且不允许下单
|
|
|
- if ($unMeet === 1) {
|
|
|
+ if ($unMeet === 2) {
|
|
|
if ($minAmount > 0 && (float)$actPrice < $minAmount) {
|
|
|
return "满{$minAmount}元 可{$methodName}";
|
|
|
}
|
|
|
@@ -265,12 +265,12 @@ class ShMethodClass extends BaseClass
|
|
|
}
|
|
|
|
|
|
// 不满最低消费但允许加收费用时,校验包装费/运费是否已写入采购单,防止前端绕过
|
|
|
- if (($unMeet === 0 || $unMeet === 2) && $unMeetFee > 0) {
|
|
|
- // unMeet === 0 加收运费, unMeet === 2 加收包装费
|
|
|
- $feeToCheck = $unMeet === 2 ? $packCost : $sendCost;
|
|
|
+ if (($unMeet === 0 || $unMeet === 1) && $unMeetFee > 0) {
|
|
|
+ // unMeet === 0 加收运费, unMeet === 1 加收包装费
|
|
|
+ $feeToCheck = $unMeet === 1 ? $packCost : $sendCost;
|
|
|
|
|
|
// 如果今天已经收过对应的附加费用,则直接通过校验
|
|
|
- if ($unMeet === 2 && self::isPackPaidToday($customId, $style)) {
|
|
|
+ if ($unMeet === 1 && self::isPackPaidToday($customId, $style)) {
|
|
|
return '';
|
|
|
}
|
|
|
if ($unMeet === 0 && self::isSendCostPaidToday($customId, $style)) {
|
|
|
@@ -278,7 +278,7 @@ class ShMethodClass extends BaseClass
|
|
|
}
|
|
|
|
|
|
if (bccomp((string)$feeToCheck, (string)$unMeetFee, 2) < 0) {
|
|
|
- $feeLabel = $unMeet === 2 ? '包装费' : '运费';
|
|
|
+ $feeLabel = $unMeet === 1 ? '包装费' : '运费';
|
|
|
return "未达最低消费,需加收{$feeLabel}{$unMeetFee}元";
|
|
|
}
|
|
|
}
|
|
|
@@ -378,12 +378,12 @@ class ShMethodClass extends BaseClass
|
|
|
$unMeetFee = isset($config['unMeetFee']) ? (float)$config['unMeetFee'] : 0;
|
|
|
|
|
|
if ($unMeetFee > 0) {
|
|
|
- // unMeet: 0 加收运费(默认),2 加收包装费
|
|
|
+ // unMeet: 0 加收运费(默认),1 加收包装费,2 不能下单
|
|
|
if ($unMeet === 0) {
|
|
|
if (!self::isSendCostPaidToday($customId, $style)) {
|
|
|
$costs['sendCost'] = $unMeetFee;
|
|
|
}
|
|
|
- } elseif ($unMeet === 2) {
|
|
|
+ } elseif ($unMeet === 1) {
|
|
|
if (!self::isPackPaidToday($customId, $style)) {
|
|
|
$costs['packCost'] = $unMeetFee;
|
|
|
}
|