shish 3 лет назад
Родитель
Сommit
b086ead0ff
2 измененных файлов с 13 добавлено и 10 удалено
  1. 7 5
      app-hd/controllers/NoticeController.php
  2. 6 5
      app-hd/controllers/PurchaseController.php

+ 7 - 5
app-hd/controllers/NoticeController.php

@@ -69,11 +69,13 @@ class NoticeController extends PublicController
             if ($capitalType == dict::getDict('capitalType', 'xhPurchase', 'id')) {
                 $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
 
-                //标记当天已收一次包装费,岭南批发市场用的功能
-                $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 (isset($cg->sendType) && $cg->sendType == 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']);
+                }
 
                 if (!empty($cg) && $cg->payStatus == 1) {
                     //微信通知

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

@@ -336,11 +336,12 @@ class PurchaseController extends BaseController
             PurchaseService::debt($info);
             $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']);
-
+            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新订单通知
             $saleId = $info->saleId ?? 0;