Tree 2 дней назад
Родитель
Сommit
6f99169176

+ 6 - 1
app/Game/GlobalUserInfo.php

@@ -222,7 +222,12 @@ class GlobalUserInfo extends Model
 //            if($makeBB){
 //                $data['bb']=['token'=>(new BetbyService())->getDefaultJWT($u)];
 //            }
-            $data['vip'] = VipService::calculateVipLevel($data['UserID'] ?? 0);
+            $userRecharge = DB::table('QPAccountsDB.dbo.YN_VIPAccount')
+                ->where('UserID', $data['UserID'])
+                ->value('Recharge') ?? 0;
+
+            $data['vip'] = VipService::calculateVipLevel($data['UserID'] ?? 0,$userRecharge);
+            $data['vipExp'] = $userRecharge;
             //intval(GameScoreInfo::query()->select(['Score'])->where('UserID', $data['UserID'])->first()->Score) / 100;
         }
         return $data;

+ 2 - 0
app/Http/Controllers/Game/WebRouteController.php

@@ -22,6 +22,7 @@ use App\IpLocation;
 use App\Models\AccountsInfo;
 use App\Models\SystemStatusInfo;
 use App\Services\ApkService;
+use App\Services\VipService;
 use App\Util;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
@@ -172,6 +173,7 @@ class WebRouteController extends Controller
             'getStateToWhereRaw' =>RouteService::getStateToWhereRaw($request),
 
             'serviceLink' => $chat?$chat->StatusString:'',
+            'vipConfig' => VipService::getVipLevelConfig(),
 
             'popWheel'=>0,
             'firstBonus'=>$firstBonus,

+ 1 - 1
app/Http/logic/api/WDPayLogic.php

@@ -64,7 +64,7 @@ class WDPayLogic extends BaseApiLogic
             "amount" => number_format($pay_amount, 2, '.', ''),  // 价格,必须保留2位小数
             "platform" =>Util::getDeviceType(),  // 设备:android/ios
             "ip" => $buyIP,  // 用户真实IP
-            "username" => $userName ?: 'user' . $userId,  // 用户名称
+            "username" => 'user' . $userId,  // 用户名称
             "customer" => $config['customer'],  // 商户简称
             "customerNo" => $config['customerNo'],  // 商户编号
             "customerOrderNo" => $order_sn,  // 商户自定义订单号

+ 1 - 4
app/Services/VipService.php

@@ -14,7 +14,7 @@ class VipService
      * @param int $userId 用户ID
      * @return int VIP等级
      */
-    public static function calculateVipLevel($userId)
+    public static function calculateVipLevel($userId,$userRecharge=0)
     {
         if (!$userId) {
             return 0;
@@ -22,9 +22,6 @@ class VipService
 
         try {
             // 获取用户累计充值金额(从 YN_VIPAccount 表)
-            $userRecharge = DB::table('QPAccountsDB.dbo.YN_VIPAccount')
-                ->where('UserID', $userId)
-                ->value('Recharge') ?? 0;
 
             // 如果没有充值记录,返回VIP 0
             if ($userRecharge <= 0) {