Bladeren bron

不重复算运费

shish 2 jaren geleden
bovenliggende
commit
b19f7a4acf
2 gewijzigde bestanden met toevoegingen van 20 en 14 verwijderingen
  1. 14 10
      app-hd/controllers/NoticeController.php
  2. 6 4
      app-hd/controllers/PurchaseController.php

+ 14 - 10
app-hd/controllers/NoticeController.php

@@ -71,11 +71,13 @@ class NoticeController extends PublicController
                 $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
 
                 if (isset($cg->localOrder) && $cg->localOrder == 1) {
-                    //昆明发货,客户算了一次打包费和运费,第二次就不再算了
-                    $customId = $cg->customId ?? 0;
-                    $current = date("Y_m_d");
-                    $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
-                    Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
+                    if ($cg->transType != 5 && $cg->transType != 4) {
+                        //昆明发货,客户算了一次打包费和运费,第二次就不再算了
+                        $customId = $cg->customId ?? 0;
+                        $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($cg->sendType) && $cg->sendType == 4) {
                         //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
@@ -308,11 +310,13 @@ class NoticeController extends PublicController
                     if (!empty($cg) && $cg->payStatus == 1) {
 
                         if (isset($cg->localOrder) && $cg->localOrder == 1) {
-                            //昆明发货,客户算了一次打包费和运费,第二次就不再算了
-                            $customId = $cg->customId ?? 0;
-                            $current = date("Y_m_d");
-                            $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
-                            Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
+                            if ($cg->transType != 5 && $cg->transType != 4) {
+                                //昆明发货,客户算了一次打包费和运费,第二次就不再算了
+                                $customId = $cg->customId ?? 0;
+                                $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($cg->sendType) && $cg->sendType == 4) {
                                 //标记当天发快递方式已收一次包装费,岭南批发市场用的功能

+ 6 - 4
app-hd/controllers/PurchaseController.php

@@ -474,10 +474,12 @@ class PurchaseController extends BaseController
             $transaction->commit();
 
             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']);
+                if ($info->transType != 5 && $info->transType != 4) {
+                    //昆明发货,客户算了一次打包费和运费,第二次就不再算了
+                    $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) {
                     //标记当天已收一次包装费,岭南批发市场用的功能