浏览代码

配送方式 正式开始大改 4

shish 3 周之前
父节点
当前提交
c557e92ae5
共有 2 个文件被更改,包括 36 次插入25 次删除
  1. 27 18
      app-hd/controllers/NoticeController.php
  2. 9 7
      app-hd/controllers/PurchaseController.php

+ 27 - 18
app-hd/controllers/NoticeController.php

@@ -192,19 +192,22 @@ class NoticeController extends PublicController
                         Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                     }
                 } else {
-                    if (isset($cg->sendType) && $cg->sendType == 4) {
-                        //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
-                        $customId = $cg->customId ?? 0;
-                        $current = date("Y_m_d");
-                        if ($cg->packCost > 0) {
+                    //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
+                    $customId = $cg->customId ?? 0;
+                    $current = date("Y_m_d");
+                    if ($cg->packCost > 0) {
+                        if (isset($cg->sendType) && $cg->sendType == 4) {
                             $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
                             Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                         }
-                        if ($cg->sendCost > 0) {
+                    }
+                    if ($cg->sendCost > 0) {
+                        if (isset($cg->sendType) && $cg->sendType == 0) {
                             $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
                             Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                         }
                     }
+
                 }
 
                 if (!empty($cg) && $cg->payStatus == 1) {
@@ -413,15 +416,17 @@ class NoticeController extends PublicController
                         Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                     }
                 } else {
-                    if (isset($cg->sendType) && $cg->sendType == 4) {
-                        //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
-                        $customId = $cg->customId ?? 0;
-                        $current = date("Y_m_d");
-                        if ($cg->packCost > 0) {
+                    //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
+                    $customId = $cg->customId ?? 0;
+                    $current = date("Y_m_d");
+                    if ($cg->packCost > 0) {
+                        if (isset($cg->sendType) && $cg->sendType == 4) {
                             $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
                             Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                         }
-                        if ($cg->sendCost > 0) {
+                    }
+                    if ($cg->sendCost > 0) {
+                        if (isset($cg->sendType) && $cg->sendType == 0) {
                             $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
                             Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                         }
@@ -582,19 +587,23 @@ class NoticeController extends PublicController
                         Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                     }
                 } else {
-                    if (isset($cg->sendType) && $cg->sendType == 4) {
-                        //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
-                        $customId = $cg->customId ?? 0;
-                        $current = date("Y_m_d");
-                        if ($cg->packCost > 0) {
+
+                    //标记当天发快递方式已收一次包装费,岭南批发市场用的功能
+                    $customId = $cg->customId ?? 0;
+                    $current = date("Y_m_d");
+                    if ($cg->packCost > 0) {
+                        if (isset($cg->sendType) && $cg->sendType == 4) {
                             $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
                             Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                         }
-                        if ($cg->sendCost > 0) {
+                    }
+                    if ($cg->sendCost > 0) {
+                        if (isset($cg->sendType) && $cg->sendType == 0) {
                             $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
                             Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                         }
                     }
+
                 }
 
                 if (!empty($cg) && $cg->payStatus == 1) {

+ 9 - 7
app-hd/controllers/PurchaseController.php

@@ -713,12 +713,12 @@ class PurchaseController extends BaseController
                     $shMethodItemAmount,
                     $shMethodBigNum
                 );
-                
+
                 // 如果产生了附加运费,与前面可能产生的 sendCost 进行累加或覆盖
                 if ($additionalCosts['sendCost'] > 0) {
                     $post['sendCost'] = bcadd($post['sendCost'] ?? 0, $additionalCosts['sendCost'], 2);
                 }
-                
+
                 // 如果产生了附加包装费,覆盖前面赋值的 packCost
                 if ($additionalCosts['packCost'] > 0) {
                     $post['packCost'] = $additionalCosts['packCost'];
@@ -949,14 +949,16 @@ class PurchaseController extends BaseController
                     Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                 }
             } else {
-                if (isset($info->sendType) && $info->sendType == 4) {
-                    //标记当天已收一次包装费,岭南批发市场用的功能
-                    $current = date("Y_m_d");
-                    if ($info->packCost > 0) {
+                //标记当天已收一次包装费,岭南批发市场用的功能
+                $current = date("Y_m_d");
+                if ($info->packCost > 0) {
+                    if (isset($info->sendType) && $info->sendType == 4) {
                         $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
                         Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                     }
-                    if ($info->sendCost > 0) {
+                }
+                if ($info->sendCost > 0) {
+                    if (isset($info->sendType) && $info->sendType == 0) {
                         $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
                         Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                     }