Ver Fonte

满足或已收过,这二个情况 都可以让下次不再收取

shish há 3 semanas atrás
pai
commit
8cdbbf38d6

+ 28 - 37
app-hd/controllers/NoticeController.php

@@ -192,22 +192,17 @@ class NoticeController extends PublicController
                         Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                     }
                 } else {
-                    //标记当天发快递方式已收一次包装费,岭南批发市场用的功能,关键词 sh_method_area
+                    //标记当天发快递方式已收一次包装费/运费,岭南批发市场用的功能,关键词 sh_method_area,只要有成功单就标记,不再要求金额必须>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 (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 (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 (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) {
@@ -416,20 +411,16 @@ class NoticeController extends PublicController
                         Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                     }
                 } else {
-                    //标记当天发快递方式已收一次包装费,岭南批发市场用的功能,关键词 sh_method_area
+                    //标记当天发快递方式已收一次包装费/运费,岭南批发市场用的功能,关键词 sh_method_area,只要有成功单就标记,不再要求金额必须>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 (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 (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 (isset($cg->sendType) && $cg->sendType == 0) {
+                        $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
+                        Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                     }
                 }
 
@@ -588,20 +579,16 @@ class NoticeController extends PublicController
                     }
                 } else {
 
-                    //标记当天发快递方式已收一次包装费,岭南批发市场用的功能,关键词 sh_method_area
+                    //标记当天发快递方式已收一次包装费/运费,岭南批发市场用的功能,关键词 sh_method_area,只要有成功单就标记,不再要求金额必须>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 (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 (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 (isset($cg->sendType) && $cg->sendType == 0) {
+                        $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
+                        Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                     }
 
                 }
@@ -849,13 +836,17 @@ class NoticeController extends PublicController
                                 Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                             }
                         } else {
+                            //标记当天发快递方式已收一次包装费/运费,岭南批发市场用的功能,关键词 sh_method_area,只要有成功单就标记,不再要求金额必须>0
+                            $customId = $cg->customId ?? 0;
+                            $current = date("Y_m_d");
                             if (isset($cg->sendType) && $cg->sendType == 4) {
-                                //标记当天发快递方式已收一次包装费,岭南批发市场用的功能,关键词 sh_method_area
-                                $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 == 0) {
+                                $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
+                                Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
+                            }
                         }
 
                         //微信通知

+ 8 - 12
app-hd/controllers/PurchaseController.php

@@ -952,21 +952,17 @@ class PurchaseController extends BaseController
                     Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                 }
             } else {
-                //标记当天已收一次包装费,岭南批发市场用的功能
+                //标记当天已收一次包装费/运费,岭南批发市场用的功能,只要有成功订单就标记,不再要求金额必须>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 (isset($info->sendType) && $info->sendType == 4) {
+                    $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
+                    Yii::$app->redis->executeCommand('SETEX', [$key, 86400, '1']);
                 }
                 noticeUtil::push("运费:" . $info->sendCost . ' sendType:' . $info->sendType, '15280215347');
-                if ($info->sendCost > 0) {
-                    if (isset($info->sendType) && $info->sendType == 0) {
-                        noticeUtil::push("执行到了", '15280215347');
-                        $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
-                        Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
-                    }
+                if (isset($info->sendType) && $info->sendType == 0) {
+                    noticeUtil::push("执行到了", '15280215347');
+                    $sendKey = 'ghs_custom_today_has_get_send_cost_' . $current . '_' . $customId;
+                    Yii::$app->redis->executeCommand('SETEX', [$sendKey, 86400, '1']);
                 }
             }