Tree 6 ساعت پیش
والد
کامیت
778619c5d0
2فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 2 1
      app/Http/Controllers/Game/LoginController.php
  2. 9 1
      app/Http/logic/api/SfPayLogic.php

+ 2 - 1
app/Http/Controllers/Game/LoginController.php

@@ -93,10 +93,11 @@ class LoginController extends Controller
         $user = GlobalUserInfo::query()->where('RegionID', $config->isRegionUnique())->where("Phone", $Phone)->first();
         if ($user) {
             $user = GlobalUserInfo::toWebData($user);
-            Util::WriteLog('phone_login',$Phone);
+            Util::WriteLog('phone_login',['success',$Phone,$config]);
             $this->dispatchIpRiskCheck($user['UserID'] ?? 0);
             return response()->json(apiReturnSuc($user, ['login.success', 'Login bem-sucedido, bem-vindo de volta!']));//->withCookie($this->setLoginCookie($user['sign']));
         } else {
+            Util::WriteLog('phone_login',[$Phone,$config]);
             return apiReturnFail(['web.login.notfound', 'Sua conta não foi encontrada, registre-se ou tente novamente!']);
         }
 

+ 9 - 1
app/Http/logic/api/SfPayLogic.php

@@ -186,6 +186,14 @@ class SfPayLogic extends BaseApiLogic
         $body['pay_at'] = date('Y-m-d H:i:s');
         $body['finished_at'] = date('Y-m-d H:i:s');
         $body['amount'] = (int) round($payAmt * NumConfig::NUM_VALUE);
+        $config = (new PayConfig())->getConfig('SfPay');
+        $body['payment_fee'] = 0;
+        $payRates = @$config['pay_rate'];
+        if(is_array($payRates)){
+            $payMethod = $order->order_title??1;
+            $payRate = $payRates[$payMethod] ?? $payRates[1];
+            $body['payment_fee'] = intval(($body['amount'] * ($payRate[0] ?? 15))/100)+($payRate[1]??0.3)*NumConfig::NUM_VALUE;
+        }
 
         try {
             $orderService = new OrderServices();
@@ -208,7 +216,7 @@ class SfPayLogic extends BaseApiLogic
             [$Score] = $orderService->addRecord(
                 $userID, $payAmt, $favorable_price, $order_no, $GiftsID,
                 $Recharge, $czReason, $give, $cjReason, $AdId, $eventType,
-                0
+                $body['payment_fee']
             );
 
             // 异步处理后续任务