فهرست منبع

包装费用问题

shish 3 سال پیش
والد
کامیت
2a32b2e8bd
2فایلهای تغییر یافته به همراه18 افزوده شده و 6 حذف شده
  1. 10 1
      app-hd/controllers/NoticeController.php
  2. 8 5
      app-hd/controllers/PurchaseController.php

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

@@ -68,6 +68,15 @@ class NoticeController extends PublicController
             //零售采购结账通知
             if ($capitalType == dict::getDict('capitalType', 'xhPurchase', 'id')) {
                 $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
+
+                //标记当天已收一次包装费,岭南批发市场用的功能
+                if (isset($cg->packCost) && $cg->packCost > 0) {
+                    $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) {
                     //微信通知
                     $saleId = $cg->saleId ?? 0;
@@ -163,7 +172,7 @@ class NoticeController extends PublicController
                 $text = "【退款失败】退款单号:{$orderSn} {$out_refund_no} 订单金额:{$new_total_fee} 退款金额:{$new_settlement_refund_fee} ";
             }
             $transaction->commit();
-            if(!empty($text)){
+            if (!empty($text)) {
                 noticeUtil::push($text, '15280215347');
             }
             echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';

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

@@ -293,11 +293,6 @@ class PurchaseController extends BaseController
 
             $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']);
-
             util::success($respond);
 
         } catch (Exception $e) {
@@ -340,6 +335,14 @@ class PurchaseController extends BaseController
             //延期支付
             PurchaseService::debt($info);
             $transaction->commit();
+
+            //标记当天已收一次包装费,岭南批发市场用的功能
+            if (isset($info->packCost) && $info->packCost > 0) {
+                $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;
             $order = OrderClass::getById($saleId, true);