[色子游戏]抽奖记录(测试权重)-优化
[API]记录抽奖券DicePlayerTicketRecord
This commit is contained in:
@@ -43,18 +43,20 @@ class DicePlayRecordTestController extends BaseController
|
||||
['is_win', ''],
|
||||
['win_coin_min', ''],
|
||||
['win_coin_max', ''],
|
||||
['paid_amount', ''],
|
||||
['ante', ''],
|
||||
['reward_tier', ''],
|
||||
['roll_number', ''],
|
||||
]);
|
||||
$query = $this->logic->search($where);
|
||||
$query->with(['diceLotteryPoolConfig', 'diceRewardConfig']);
|
||||
|
||||
// 按当前筛选条件统计:平台总盈利 = 付费抽奖(lottery_type=0)次数×100 - 玩家总收益(win_coin 求和)
|
||||
// 按当前筛选条件统计:平台总盈利 = 付费金额(paid_amount 求和) - 玩家总收益(win_coin 求和)
|
||||
$sumQuery = clone $query;
|
||||
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
||||
$paidCountQuery = clone $query;
|
||||
$paidCount = (int) $paidCountQuery->where('lottery_type', 0)->count();
|
||||
$totalWinCoin = $paidCount * 100 - $playerTotalWin;
|
||||
$paidAmountQuery = clone $query;
|
||||
$paidAmount = (float) $paidAmountQuery->where('lottery_type', 0)->sum('paid_amount');
|
||||
$totalWinCoin = $paidAmount - $playerTotalWin;
|
||||
|
||||
$data = $this->logic->getList($query);
|
||||
$data['total_win_coin'] = $totalWinCoin;
|
||||
|
||||
@@ -42,6 +42,7 @@ class DicePlayerTicketRecordController extends BaseController
|
||||
['username', ''],
|
||||
['use_coins_min', ''],
|
||||
['use_coins_max', ''],
|
||||
['ante', ''],
|
||||
['total_ticket_count_min', ''],
|
||||
['total_ticket_count_max', ''],
|
||||
['paid_ticket_count_min', ''],
|
||||
|
||||
@@ -90,6 +90,7 @@ class DiceRewardController extends BaseController
|
||||
{
|
||||
$post = is_array($request->post()) ? $request->post() : [];
|
||||
$params = [
|
||||
'ante' => $post['ante'] ?? null,
|
||||
'lottery_config_id' => $post['lottery_config_id'] ?? null,
|
||||
'paid_lottery_config_id' => $post['paid_lottery_config_id'] ?? null,
|
||||
'free_lottery_config_id' => $post['free_lottery_config_id'] ?? null,
|
||||
|
||||
Reference in New Issue
Block a user