瀏覽代碼

1、自动免审
2、添加免费币
3、pwabonus

Tree 1 周之前
父節點
當前提交
1e4ce599a4

+ 2 - 2
app/Console/Commands/ExemptReview.php

@@ -93,7 +93,7 @@ class ExemptReview extends Command
                 $sameCountCheckIP = 100;
             }
 
-            if($verifyRes==1||$verifyRes==9){
+            if(($verifyRes==1||$verifyRes==9)&&$value->WithDraw!=1000){
                 Log::info('首次审核阻拦自动免审:'.$value->OrderId);
                 continue;
             }
@@ -156,7 +156,7 @@ class ExemptReview extends Command
                 $redis->set($order_sn.'key1', $order_sn, 3600 * 24);
                 $log = ['user_id'   => $value->UserID,
                         'config_id' => $config->id,
-                        'use_quota' => $value->WithDraw,
+                        'use_quota' => intval($value->WithDraw),
                         'order_sn'  => $value->OrderId];
                 DB::connection('write')->table('agent.dbo.withdrawal_position_log')
                   ->updateOrInsert(['order_sn' => $value->OrderId], $log);

+ 21 - 0
app/Game/Services/OuroGameService.php

@@ -103,4 +103,25 @@ class OuroGameService
 
 
     }
+
+    public static function AddFreeScore($UserID,$GiftScore,$reason=null,$notify=true)
+    {
+        $vip = DB::table(TableName::QPAccountsDB() . 'YN_VIPAccount')
+            ->where('UserID', $UserID)
+            ->value('Recharge') ?: 0;
+        if($vip){
+            // 增加用户金币
+            $OrgScore = DB::table('QPTreasureDB.dbo.GameScoreInfo')->where('UserID', $UserID)->value('InsureScore');
+            DB::table('QPTreasureDB.dbo.GameScoreInfo')->where('UserID', $UserID)->increment('InsureScore',$GiftScore);
+            $NowScore=$OrgScore+$GiftScore;
+        }else{
+            // 增加用户金币
+            $OrgScore = DB::table('QPTreasureDB.dbo.GameScoreInfo')->where('UserID', $UserID)->value('Score');
+            DB::table('QPTreasureDB.dbo.GameScoreInfo')->where('UserID', $UserID)->increment('Score',$GiftScore);
+            $NowScore=$OrgScore+$GiftScore;
+        }
+
+
+        return [$OrgScore,$NowScore];
+    }
 }

+ 1 - 0
app/Http/Controllers/Admin/RechargeController.php

@@ -261,6 +261,7 @@ class RechargeController extends Controller
                 '301' => '首充',
                 '302' => '破产礼包',
                 '401' => '转盘活动充值',
+                '402' => '圣诞活动',
             ];
             // 充值金额 10,50,100,200,300.500,800,1000,2000,5000,10000,20000,50000,80000,100000
             $chargeMoneyList = [10,20, 50, 100, 200, 500, 1000, 5000, 10000, 30000];

+ 5 - 0
app/Http/Controllers/Api/AiPayController.php

@@ -84,6 +84,11 @@ class AiPayController implements PayMentInterFace
 
         $service = new AiPay('AiPayOut');
 
+        if($post['amount']){
+            $post['amount'] = number_format($post['amount'], 2, '.', '');
+        }
+
+
         if (!$service->verify($post)) {
             Util::WriteLog('AiPay', 'cash notify verify failed');
             return 'fail';

+ 29 - 16
app/Http/Controllers/Game/LoginController.php

@@ -611,6 +611,30 @@ class LoginController extends Controller
         return response()->json(apiReturnSuc('', ['logout.success', 'Você saiu com sucesso.']))->withCookie(self::clearLoginCookie());
     }
 
+
+    public static function getPwaBonus(Request $request)
+    {
+        $user=$request->user();
+        $haveBonus=Redis::get('pwa_bonus:'.$user->UserID);
+        $config = RouteService::getChannelConfig($request);
+        if($haveBonus&&$config->BONUS_PWA()>0){
+            [$OrgScore,$NowScore]=OuroGameService::AddFreeScore($user->UserID,$config->BONUS_PWA(),OuroGameService::REASON_PwaBonus,false);
+            $data=GlobalUserInfo::toWebData($user);
+            $data['Score']=$NowScore;
+            Redis::del('pwa_bonus:'.$user->UserID);
+
+            if(date('Ymd',strtotime($user->RegisterDate)) == date('Ymd')){
+                $RecordPlatformDataModel = new \App\Models\RecordPlatformData();
+                $RecordPlatformDataModel->PwaToday($user->Channel);
+            }
+
+            return response()->json(apiReturnSuc($data, ['user.bonus.pwa_bonus_success', 'Bônus PWA recebido com sucesso!']));
+        }else{
+            return response()->json(apiReturnFail(['user.bonus.pwa_bonus_fail', 'Você já recebeu o bônus PWA.',$haveBonus,$config->BONUS_PWA()]));
+        }
+
+    }
+
     private function isSequentialOrRepetitive($phoneNumber)
     {
         // 移除国家代码和非数字字符
@@ -667,22 +691,11 @@ class LoginController extends Controller
                         }
                         GlobalUserInfo::$me = $user;
                         if (intval($request->input('pwa', 0)) == 1) {
-                            $redisKey = 'pwa_install_bonus_' . $user->UserID;
-                            if (SetNXLock::getExclusiveLock($redisKey, 10)) {
-                                try {
-                                    if (intval($user->PwaInstalled) == 0) {
-                                        $user->update(['PwaInstalled' => 1]);
-                                        $config = RouteService::getChannelConfig($request);
-                                        if($config->BONUS_PWA()>0){
-                                            OuroGameService::AddScore($user->UserID,$config->BONUS_PWA(),OuroGameService::REASON_PwaBonus,false);
-                                        }
-                                        if(date('Ymd',strtotime($user->RegisterDate)) == date('Ymd')){
-                                            $RecordPlatformDataModel = new \App\Models\RecordPlatformData();
-                                            $RecordPlatformDataModel->PwaToday($user->Channel);
-                                        }
-                                    }
-                                } finally {
-                                    SetNXLock::release($redisKey);
+                            if (intval($user->PwaInstalled) == 0) {
+                                $user->update(['PwaInstalled' => 1]);
+                                $config = RouteService::getChannelConfig($request);
+                                if($config->BONUS_PWA()>0){
+                                    Redis::setex('pwa_bonus:'.$user->UserID,86400,1);
                                 }
                             }
                         }

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

@@ -142,6 +142,7 @@ class WebRouteController extends Controller
         // 默认推荐游戏
         $defaultGameId = 931;
         $recommendGame = '/game/' . $defaultGameId;
+        $popPwaBonus=$user?(Redis::get('pwa_bonus:'.$user['UserID'])??0):0;
         $ChannelPackageName = DB::table('QPPlatformDB.dbo.ChannelPackageName')->where('Channel',$config->Channel??100)
             ->first();
         $data['conf']=[
@@ -172,6 +173,7 @@ class WebRouteController extends Controller
             'popFirst'=>$firstBonus,
             'openRelief'=>$firstBonus,
             'popBindPhone'=>1,
+            'popPwaBonus'  => $popPwaBonus,
             'download'=>['light'=>$config->LightApk,'full'=>$config->FullApk,'bonus'=>$config->BONUS_PWA()],
             'registerOpen'=>$config->RegOpen??env('CONFIG_REG_OPEN','sms,mail'),//id,phone,sms,mail,guest
             'loginOpen'=>$config->LoginOpen??'id,phone,sms,mail,guest'

+ 37 - 6
app/Http/logic/api/AiPayCashierLogic.php

@@ -3,6 +3,7 @@
 namespace App\Http\logic\api;
 
 use App\dao\Estatisticas\RechargeWithDraw;
+use App\dao\Pay\AccountPayInfo;
 use App\Http\helper\NumConfig;
 use App\Inter\CashierInterFace;
 use App\Models\PrivateMail;
@@ -29,11 +30,16 @@ class AiPayCashierLogic implements CashierInterFace
         $service = new AiPay('AiPayOut');
         $config = $service->getConfig();
 
+        if(!$accountName){
+            $dao = new AccountPayInfo();
+            $$accountName = $dao->randUserName($accountName);
+        }
+
         $paymentMethod = $this->resolvePaymentMethod($PixType);
         $accountData = $this->buildAccountData($paymentMethod, $accountName, $PixNum, $email, $phone, $IFSCNumber, $BranchBank, $BankNO);
 
         if ($paymentMethod === null || empty($accountData)) {
-            Util::WriteLog('AiPay', 'unsupported PixType for withdraw: ' . $PixType);
+            Util::WriteLog('AiPay', 'unsupported PixType for withdraw: ' . $PixType.'_'.$accountName);
             return 'fail';
         }
 
@@ -192,16 +198,41 @@ class AiPayCashierLogic implements CashierInterFace
         return [];
     }
 
-    protected function splitName($name): array
+//    protected function splitName($name): array
+//    {
+//        $name = trim($name ?: 'User');
+//        $parts = preg_split('/\s+/', $name, 2);
+//        return [
+//            'first' => $parts[0] ?? 'User',
+//            'last' => $parts[1] ??  'Edward',
+//        ];
+//    }
+
+    protected function splitName(string $name = null): array
     {
-        $name = trim($name ?: 'User');
-        $parts = preg_split('/\s+/', $name, 2);
+        $name = trim($name ?? '');
+        if ($name === '') $name = 'Willam Edson';
+
+//        // 处理 "Last, First"
+//        if (str_contains($name, ',')) {
+//            $tmp = array_map('trim', explode(',', $name, 2));
+//            $name = ($tmp[1] ?? '') . ' ' . ($tmp[0] ?? '');
+//            $name = trim($name);
+//        }
+
+        // 清洗:保留字母、空格、-、'
+        $name = preg_replace("/[^A-Za-z\\s\\-']/u", ' ', $name);
+        $name = trim(preg_replace('/\s+/', ' ', $name));
+
+        $parts = explode(' ', $name, 2);
+
         return [
-            'first' => $parts[0] ?? 'User',
-            'last' => $parts[1] ?? ($parts[0] ?? 'User'),
+            'first' => $parts[0] ?: 'Willam',
+            'last'  => $parts[1] ?? 'Edward', // 或 'Edward' / 'User'
         ];
     }
 
+
     protected function extractMonth($value): string
     {
         if (preg_match('/(\d{2})/', (string)$value, $match)) {

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

@@ -41,7 +41,7 @@ class AiPayLogic extends BaseApiLogic
         $order_sn = CreateOrder::order_sn($userId);
         $orderLogic = new OrderLogic();
         $amountInt = (int) round($pay_amount * NumConfig::NUM_VALUE);
-        $orderLogic->orderCreate($order_sn, $amountInt, 'AiPay', $userId, '', $GiftsID, $AdId, $eventType);
+        $orderLogic->orderCreate($order_sn, $amountInt, 'AiPay', $userId, $pay_method, $GiftsID, $AdId, $eventType);
 
         $methodMap = [
             1 => '1101',

+ 3 - 0
app/Models/Order.php

@@ -269,6 +269,9 @@ class Order extends Model
             case 401:
                 $GiftsName = '大转盘';
                 break;
+            case 402:
+                $GiftsName = '圣诞礼包';
+                break;
 
             default:
                 $GiftsName = '商城(充值)';

+ 2 - 1
app/Services/AiPay.php

@@ -77,7 +77,8 @@ class AiPay
                 continue;
             }
             if (is_array($value)) {
-                $signParams[$key] = $this->buildObjectString($value);
+//                $signParams[$key] = $this->buildObjectString($value);
+                $signParams[$key] = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);;
             } else {
                 $signParams[$key] = $value;
             }

+ 4 - 0
app/Services/Withdrawal.php

@@ -38,6 +38,10 @@ class Withdrawal
         // 提现值除100
         $Withdraw /= NumConfig::NUM_VALUE;
 
+        if($Withdraw == 10){
+            return 1;
+        }
+
         // 设置默认值
         $UserWithdraw = $UserInfo->Withdraw ?? 0;
         $UserRecharge = $UserInfo->Recharge ?? 0;

+ 3 - 3
config/pay.php

@@ -52,7 +52,7 @@ return [
         'return' => env('APP_URL', '').'/api/wdpay/return',
     ],
     'WDPayOut' => [
-        'key' => '3d904b04cb504aedb78a3e2913efa2a0',
+        'key' => '5380a6be330744a1adc146803708536c',
         'customer' => 'usslot777',
         'customerNo' => '1027017801',
         'apiUrl' => 'https://pay.wonderspay.com/charging/create-pay-out',
@@ -65,8 +65,8 @@ return [
     ],
 
     'AiPay' => [
-        'mchNo' => 'TEST2311609409',
-        'key' => 'v6jtjhsrPOBFh2YRAN89TnaTRJXJ7LC9nfcHuZQneyI=',
+        'mchNo' => 'USSLOT7778313769775',
+        'key' => 'MGJmNk7fvQbE0xXzvX44fKTs98SlmgmiwpJgZ/moTvk=',
         'apiUrl' => 'https://api.7aipay.com',
         'currency' => 'USD',
         'paymentMethod' => '1101',

+ 2 - 1
resources/views/admin/Withdrawal/verify_finish.blade.php

@@ -277,7 +277,7 @@
                                                 </a>
                                             @endif
 
-
+                                            @if($item->State == 5 || ($item->State == 6 && $item->WithDraw<40))
                                             <br>
                                             @if(session('admin')->roles[0]->id==1)
                                             <a class="layer-switch"
@@ -286,6 +286,7 @@
                                                 StateTo1
                                             </a>
                                             @endif
+                                            @endif
                                         </td>
 
                                         <td>

+ 1 - 0
routes/game.php

@@ -310,6 +310,7 @@ Route::group([
     $route->any('/ouro777', 'Game\GameController@Ouro777GamePage');
 
     $route->any('/gameinfo', 'Game\GameController@GetGameInfo');
+    $route->any('/getPwaBonus', 'Game\LoginController@getPwaBonus');
 
     $route->any('/only', 'Game\OnlyGameController@gameLunch');