feat(chat): 完善后台彩票游戏的历史总览、期号列表及单期购买明细页面
This commit is contained in:
@@ -19,6 +19,8 @@ use App\Models\BaccaratRound;
|
||||
use App\Models\FortuneLog;
|
||||
use App\Models\HorseBet;
|
||||
use App\Models\HorseRace;
|
||||
use App\Models\LotteryIssue;
|
||||
use App\Models\LotteryTicket;
|
||||
use App\Models\MysteryBox;
|
||||
use App\Models\SlotMachineLog;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -73,12 +75,21 @@ class GameHistoryController extends Controller
|
||||
'today_times' => FortuneLog::query()->whereDate('created_at', today())->count(),
|
||||
];
|
||||
|
||||
// 彩票
|
||||
$lottery = [
|
||||
'total_issues' => LotteryIssue::query()->count(),
|
||||
'total_bets' => LotteryTicket::query()->count(),
|
||||
'total_pool' => LotteryIssue::query()->where('status', 'drawn')->sum('prize_pool'),
|
||||
'today_issues' => LotteryIssue::query()->whereDate('created_at', today())->count(),
|
||||
];
|
||||
|
||||
return response()->json([
|
||||
'baccarat' => $baccarat,
|
||||
'slot' => $slot,
|
||||
'horse' => $horse,
|
||||
'mystery_box' => $mysteryBox,
|
||||
'fortune' => $fortune,
|
||||
'lottery' => $lottery,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -241,4 +252,33 @@ class GameHistoryController extends Controller
|
||||
|
||||
return view('admin.game-history.fortune', compact('logs', 'summary'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 双色球彩票历史记录页面(期号列表,支持分页)。
|
||||
*/
|
||||
public function lottery(Request $request): View
|
||||
{
|
||||
$summary = [
|
||||
'total_issues' => LotteryIssue::query()->count(),
|
||||
'total_tickets' => LotteryTicket::query()->count(),
|
||||
'total_pool' => (int) LotteryIssue::query()->sum('prize_pool'),
|
||||
'drawn_count' => LotteryIssue::query()->where('status', 'drawn')->count(),
|
||||
];
|
||||
|
||||
$issues = LotteryIssue::query()
|
||||
->latest()
|
||||
->paginate(20);
|
||||
|
||||
return view('admin.game-history.lottery', compact('issues', 'summary'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 双色球单期购买明细与中奖详情。
|
||||
*/
|
||||
public function lotteryIssue(LotteryIssue $issue): View
|
||||
{
|
||||
$tickets = $issue->tickets()->with('user')->latest()->paginate(30);
|
||||
|
||||
return view('admin.game-history.lottery-issue', compact('issue', 'tickets'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user