shish 2 роки тому
батько
коміт
9b2b3cdb4d

+ 1 - 1
app-hd/controllers/CustomRechargeController.php

@@ -157,7 +157,7 @@ class CustomRechargeController extends BaseController
                 'lklCertificatePath' => $lklCertificatePath,
             ];
             $laResource = new Lakala($params);
-            $notifyUrl = Yii::$app->params['hdHost'] . "/notice/cash-pay-callback";
+            $notifyUrl = Yii::$app->params['hdHost'] . "/notice/pay-callback";
             $wxParams = [
                 'orderSn' => $customOrderSn,
                 'amount' => $totalFee,

+ 12 - 0
app-hd/controllers/NoticeController.php

@@ -314,6 +314,18 @@ class NoticeController extends PublicController
             }
             Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
 
+            //客户向供货商充值然后进行清账
+            if ($capitalType == dict::getDict('capitalType', 'customRechargeToGhs', 'id')) {
+                $customRecharge = CustomRechargeClass::getByCondition(['orderSn' => $orderSn], true);
+                $customId = $customRecharge->customId ?? 0;
+                $ghsId = $customRecharge->ghsId ?? 0;
+                $ghs = GhsClass::getLockById($ghsId);
+                $ghsShopId = $ghs->shopId ?? 0;
+                $custom = CustomClass::getLockById($customId);
+                $shop = ShopClass::getById($ghsShopId, true);
+                OrderClearClass::useBalanceClear($custom, $ghs, $shop, null);
+            }
+
             //零售采购结账通知
             if ($capitalType == dict::getDict('capitalType', 'xhPurchase', 'id')) {
                 $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);