feat: 添加结算功能,更新 TicketItem 模型以支持最新结算详情,增强 DrawTickService 以自动处理结算,更新 TicketWalletService 以支持派彩入账,扩展 API 路由以管理结算批次和奖池
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\V1\Admin\Settlement;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\SettlementBatch;
|
||||
use App\Support\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* GET /api/v1/admin/settlement-batches/{batch} — 单批次摘要。
|
||||
*/
|
||||
final class AdminSettlementBatchShowController extends Controller
|
||||
{
|
||||
public function __invoke(SettlementBatch $batch): JsonResponse
|
||||
{
|
||||
$batch->load(['draw:id,draw_no,business_date,status', 'resultBatch:id,result_version,status']);
|
||||
|
||||
return ApiResponse::success([
|
||||
'id' => (int) $batch->id,
|
||||
'draw_id' => (int) $batch->draw_id,
|
||||
'draw_no' => $batch->draw?->draw_no,
|
||||
'draw_status' => $batch->draw?->status,
|
||||
'result_batch_id' => (int) $batch->result_batch_id,
|
||||
'result_batch_version' => $batch->resultBatch?->result_version,
|
||||
'result_batch_status' => $batch->resultBatch?->status,
|
||||
'settle_version' => (int) $batch->settle_version,
|
||||
'status' => $batch->status,
|
||||
'total_ticket_count' => (int) $batch->total_ticket_count,
|
||||
'total_win_count' => (int) $batch->total_win_count,
|
||||
'total_payout_amount' => (int) $batch->total_payout_amount,
|
||||
'total_jackpot_payout_amount' => (int) $batch->total_jackpot_payout_amount,
|
||||
'started_at' => $batch->started_at?->toIso8601String(),
|
||||
'finished_at' => $batch->finished_at?->toIso8601String(),
|
||||
'created_at' => $batch->created_at?->toIso8601String(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user