Browse Source

红包 充值通知

shish 4 years ago
parent
commit
87170518f7
2 changed files with 17 additions and 10 deletions
  1. 16 4
      biz/wx/classes/WxMessageClass.php
  2. 1 6
      common/components/payUtil.php

+ 16 - 4
biz/wx/classes/WxMessageClass.php

@@ -3,8 +3,10 @@
 namespace biz\wx\classes;
 
 use biz\base\classes\BaseClass;
+use biz\ghs\classes\GhsClass;
 use biz\shop\classes\ShopAdminClass;
 use biz\shop\classes\ShopClass;
+use bizGhs\custom\classes\CustomClass;
 use common\components\dict;
 use common\components\noticeUtil;
 use common\components\util;
@@ -655,12 +657,22 @@ class WxMessageClass extends BaseClass
     }
 
     //客户充值通知供应商 shish 20211005
-    public static function customRechargeInformGhs($recharge, $hbInfo)
+    public static function customRechargeInformGhs($recharge)
     {
         $amount = $recharge->amount ?? 0;
-        $shopId = $hbInfo->ghsShopId ?? 0;
-        $customName = $hbInfo->customName ?? '';
-        $customId = $hbInfo->customId ?? 0;
+        $hbId = $recharge->hbId ?? 0;
+        $ghsId = $recharge->ghsId ?? 0;
+        if (empty($ghsId)) {
+            return false;
+        }
+        if (!empty($hbId)) {
+            return false;
+        }
+        $ghsInfo = GhsClass::getById($ghsId, true);
+        $shopId = $ghsInfo->ghsShopId ?? 0;
+        $customId = $ghsInfo->customId ?? 0;
+        $customInfo = CustomClass::getById($customId, true);
+        $customName = $customInfo->name ?? '';
         $shopInfo = ShopClass::getById($shopId, true);
         $ptStyle = $shopInfo->ptStyle ?? 0;
         $wxBase = WxOpenClass::getWxBase();

+ 1 - 6
common/components/payUtil.php

@@ -39,12 +39,7 @@ class payUtil
                     $currentRecharge = RechargeClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
                     $transaction->commit();
                     //有发红包的通知供货商
-                    $hbId = $currentRecharge->hbId ?? 0;
-                    if (empty($hbId)) {
-                        return false;
-                    }
-                    $hbInfo = HbClass::getById($hbId, true);
-                    WxMessageClass::customRechargeInformGhs($currentRecharge, $hbInfo);
+                    WxMessageClass::customRechargeInformGhs($currentRecharge);
                     break;
                 case dict::getDict('capitalType', 'xhPurchase', 'id'):
                     //零售采购