瀏覽代碼

新增统计

Tree 1 周之前
父節點
當前提交
40430f38d2

+ 1 - 1
app/Console/Commands/RecordPlatformData.php

@@ -125,7 +125,7 @@ class RecordPlatformData extends Command
         $NewGameUserCounts = $dao->NewGameUserCount($date);
 
 
-        $NewGameWinTopCounts = $dao->NewGameWinTopCount($dateID);
+        $NewGameWinTopCounts = $dao->NewGameWinTopCount($date);
 
         // 赠送金币 =====  增加赠送金币
         //$GiveGolds = RecordScoreInfo::todayLottery($date->format('Y-m-d'));

+ 4 - 0
app/Http/Controllers/Game/LoginController.php

@@ -673,6 +673,10 @@ class LoginController extends Controller
                                 if($config->BONUS_PWA()>0){
                                     OuroGameService::AddScore($user->UserID,$config->BONUS_PWA(),OuroGameService::REASON_PwaBonus,false);
                                 }
+
+                                $RecordPlatformDataModel = new \App\Models\RecordPlatformData();
+
+                                $RecordPlatformDataModel->PwaToday($user->Channel);
                             }
                         }
                         return $user;

+ 3 - 1
app/Http/logic/api/OrderLogic.php

@@ -82,6 +82,7 @@ class OrderLogic extends BaseApiLogic
         $userInfo = GlobalUserInfo::getGameUserInfo('UserID',$userID);
         $Channel = $userInfo?$userInfo->Channel:100;
         $RegisterDate = $userInfo?$userInfo->RegisterDate:date('Y-m-d');
+        $first = DB::connection('write')->table('agent.dbo.order')->where('user_id', $userID)->first();
 
         $body = [
             'app_id' => 1,
@@ -109,7 +110,8 @@ class OrderLogic extends BaseApiLogic
         }
 
         $RecordPlatformDataModel = new \App\Models\RecordPlatformData();
-        $RecordPlatformDataModel->PayRequestToday($Channel,$RegisterDate);
+
+        $RecordPlatformDataModel->PayRequestToday($Channel,$RegisterDate,!$first);
 
         return true;
     }

+ 19 - 3
app/Models/RecordPlatformData.php

@@ -300,16 +300,32 @@ class RecordPlatformData extends Model
 
     }
 
-    public function PayRequestToday($Channel, $RegisterDate)
+    public function PayRequestToday($Channel, $RegisterDate,$firstPayRequest = 0)
     {
         $dateID = Carbon::now()->format('Ymd');
         if ($dateID == date('Ymd', strtotime($RegisterDate))) {
+            $addNew = 0;
+            if ($firstPayRequest){
+                $addNew = 1;
+            }
+
             DB::table(TableName::QPRecordDB() . 'RecordPlatformData')
-                ->updateOrInsert(['Channel' => -1, 'DateID' => $dateID], ['NewPayRequest' => DB::raw("NewPayRequest+1")]);
+                ->updateOrInsert(['Channel' => -1, 'DateID' => $dateID], ['NewPayRequest' => DB::raw("NewPayRequest+1"),'NewPayRequestPeople' => DB::raw("NewPayRequestPeople+$addNew")]);
             DB::table(TableName::QPRecordDB() . 'RecordPlatformData')
-                ->updateOrInsert(['Channel' => $Channel, 'DateID' => $dateID], ['NewPayRequest' => DB::raw("NewPayRequest+1")]);
+                ->updateOrInsert(['Channel' => $Channel, 'DateID' => $dateID], ['NewPayRequest' => DB::raw("NewPayRequest+1"),'NewPayRequestPeople' => DB::raw("NewPayRequestPeople+$addNew")]);
 
         }
 
     }
+
+    public function PwaToday($Channel)
+    {
+        $dateID = Carbon::now()->format('Ymd');
+        DB::table(TableName::QPRecordDB() . 'RecordPlatformData')
+            ->updateOrInsert(['Channel' => -1, 'DateID' => $dateID], ['PwaPeople' => DB::raw("PwaPeople+1")]);
+        DB::table(TableName::QPRecordDB() . 'RecordPlatformData')
+            ->updateOrInsert(['Channel' => $Channel, 'DateID' => $dateID], ['PwaPeople' => DB::raw("PwaPeople+1")]);
+
+
+    }
 }

+ 1 - 1
app/dao/RecordPlatformData/RecordPlatformData.php

@@ -70,7 +70,7 @@ class RecordPlatformData
     public function NewGameWinTopCount($date)
     {
         return DB::connection('sqlsrv')->table(TableName::QPAccountsDB() . 'AccountsInfo as ai')
-            ->whereDate('RegisterDate', $date->format('Y-m-d'))
+            ->whereDate('ai.RegisterDate', $date->format('Y-m-d'))
             ->join(TableName::QPTreasureDB() . 'GameScoreInfo as rd', 'ai.UserID', '=', 'rd.UserID')
             ->whereRaw('(ISNULL(rd.Score,0) + ISNULL(rd.InsureScore,0)) > ?', [4000])
             ->selectRaw('COUNT(ai.UserID) AS UserCount, ai.Channel')