|
|
@@ -254,10 +254,15 @@ class PurchaseController extends BaseController
|
|
|
$sendCost = $result['fee'] ?? 0;
|
|
|
}
|
|
|
$post['sendCost'] = $sendCost;
|
|
|
- //出车和发快递可以算打包费
|
|
|
+ //出车、发快递、发物流可以算包装费
|
|
|
$packCost = 0;
|
|
|
- if ($sendType == dict::getDict('sendType', 'thirdSend') || $sendType == dict::getDict('sendType', 'carGet')) {
|
|
|
- $packCost = $ghsShopInfo->packCost ?? 0;
|
|
|
+ $itemTotalAmount = $post['itemTotalAmount'] ?? 0;
|
|
|
+ unset($post['itemTotalAmount']);
|
|
|
+ if ($sendType == dict::getDict('sendType', 'thirdSend') || $sendType == dict::getDict('sendType', 'carGet') || $sendType == dict::getDict('sendType', 'wl')) {
|
|
|
+ $needAdd = \bizHd\shop\classes\ShopClass::needAddPackCost($ghsShopInfo, $customId, $itemTotalAmount);
|
|
|
+ if ($needAdd) {
|
|
|
+ $packCost = $ghsShopInfo->packCost ?? 0;
|
|
|
+ }
|
|
|
}
|
|
|
$post['packCost'] = $packCost;
|
|
|
|
|
|
@@ -288,6 +293,11 @@ class PurchaseController extends BaseController
|
|
|
|
|
|
$transaction->commit();
|
|
|
|
|
|
+ //标记当天已收包装费,岭南批发市场
|
|
|
+ $current = date("Y_m_d");
|
|
|
+ $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
|
|
|
+
|
|
|
util::success($respond);
|
|
|
|
|
|
} catch (Exception $e) {
|