shish vor 2 Jahren
Ursprung
Commit
cc7aad8b58

+ 5 - 1
app-ghs/controllers/CustomController.php

@@ -38,6 +38,10 @@ class CustomController extends BaseController
         $get = Yii::$app->request->get();
         $amount = $get['amount'] ?? 0;
         $customId = $get['customId'] ?? 0;
+        $payWay = $get['payWay'] ?? -1;
+        if ($payWay < 0) {
+            util::fail('请选择付款方式');
+        }
         if ($amount <= 0) {
             util::fail('充值金额需要大于0');
         }
@@ -57,7 +61,7 @@ class CustomController extends BaseController
         $transaction = $connection->beginTransaction();
         try {
             $staff = $this->shopAdmin;
-            CustomService::rechargeClear($custom, $amount, $this->shop, $staff);
+            CustomService::rechargeClear($custom, $amount, $this->shop, $staff, $payWay);
             $transaction->commit();
             util::complete('充值成功');
         } catch (\Exception $e) {

+ 3 - 3
biz-ghs/custom/classes/CustomClass.php

@@ -149,7 +149,7 @@ class CustomClass extends BaseClass
     }
 
     //充值金额 ssh 20240310
-    public static function rechargeBalance($custom, $amount, $shop, $staff)
+    public static function rechargeBalance($custom, $amount, $shop, $staff, $payWay)
     {
         $ghsId = $custom->ghsId ?? 0;
         $ghsInfo = GhsClass::getLockById($ghsId);
@@ -179,7 +179,7 @@ class CustomClass extends BaseClass
         $cData = [
             'orderSn' => $orderSn,
             'onlinePay' => 1,
-            'payWay' => 0,
+            'payWay' => $payWay,
             'shopId' => $shopId,
             'mainId' => $mainId,
             'amount' => $amount,
@@ -231,7 +231,7 @@ class CustomClass extends BaseClass
         $gData = [
             'orderSn' => $orderSn,
             'onlinePay' => 1,
-            'payWay' => 0,
+            'payWay' => $payWay,
             'shopId' => $customShopId,
             'mainId' => $customMainId,
             'amount' => $amount,

+ 2 - 2
biz-ghs/custom/services/CustomService.php

@@ -15,9 +15,9 @@ class CustomService extends BaseService
     public static $baseFile = '\bizGhs\custom\classes\CustomClass';
 
     //充值和结账 ssh 20240309
-    public static function rechargeClear($custom, $amount, $shop, $staff)
+    public static function rechargeClear($custom, $amount, $shop, $staff, $payWay)
     {
-        $respond = CustomClass::rechargeBalance($custom, $amount, $shop, $staff);
+        $respond = CustomClass::rechargeBalance($custom, $amount, $shop, $staff, $payWay);
         $custom = $respond['custom'] ?? [];
         $ghs = $respond['ghs'] ?? [];
         if (empty($custom)) {