|
|
@@ -319,6 +319,11 @@ class PurchaseController extends BaseController
|
|
|
if ($transType == 4 || $transType == 5) {
|
|
|
$packCost = 0;
|
|
|
}
|
|
|
+ //如果已经算过一次打包费和运费了,则不再费了
|
|
|
+ $needAdd = \bizHd\shop\classes\ShopClass::needAddPackCost($ghsShopInfo, $customId);
|
|
|
+ if ($needAdd == false) {
|
|
|
+ $packCost = 0;
|
|
|
+ }
|
|
|
|
|
|
$post['packCost'] = $packCost;
|
|
|
|
|
|
@@ -360,6 +365,13 @@ class PurchaseController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //如果已经算过一次打包费和运费了,则不再费了
|
|
|
+ $needAdd = \bizHd\shop\classes\ShopClass::needAddPackCost($ghsShopInfo, $customId);
|
|
|
+ if ($needAdd == false) {
|
|
|
+ $sendCost = 0;
|
|
|
+ }
|
|
|
+
|
|
|
$post['sendCost'] = $sendCost;
|
|
|
//标记为昆明到地方订单
|
|
|
$post['localOrder'] = 1;
|
|
|
@@ -461,11 +473,18 @@ class PurchaseController extends BaseController
|
|
|
PurchaseService::debt($info);
|
|
|
$transaction->commit();
|
|
|
|
|
|
- if (isset($info->sendType) && $info->sendType == 4) {
|
|
|
- //标记当天已收一次包装费,岭南批发市场用的功能
|
|
|
+ if (isset($info->localOrder) && $info->localOrder == 1) {
|
|
|
+ //昆明发货,客户算了一次打包费和运费,第二次就不再算了
|
|
|
$current = date("Y_m_d");
|
|
|
$key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
|
|
|
Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
|
|
|
+ } else {
|
|
|
+ if (isset($info->sendType) && $info->sendType == 4) {
|
|
|
+ //标记当天已收一次包装费,岭南批发市场用的功能
|
|
|
+ $current = date("Y_m_d");
|
|
|
+ $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//app新订单通知
|