1.优化websocket中的jackpot.hit
2.优化/api/game/betMyOrders接口,新增中奖号码字段result_number
This commit is contained in:
@@ -401,8 +401,40 @@ class Game extends MobileBase
|
||||
'list_rows' => $pageSize,
|
||||
]);
|
||||
|
||||
$periodIds = [];
|
||||
foreach ($paginate->items() as $item) {
|
||||
$periodIdValue = filter_var($item->period_id ?? null, FILTER_VALIDATE_INT);
|
||||
if ($periodIdValue !== false && $periodIdValue > 0) {
|
||||
$periodIds[] = $periodIdValue;
|
||||
}
|
||||
}
|
||||
$periodIds = array_values(array_unique($periodIds));
|
||||
$resultNumberByPeriodId = [];
|
||||
if ($periodIds !== []) {
|
||||
$periodRows = Db::name('game_record')
|
||||
->whereIn('id', $periodIds)
|
||||
->field(['id', 'result_number'])
|
||||
->select()
|
||||
->toArray();
|
||||
foreach ($periodRows as $row) {
|
||||
if (!is_array($row)) {
|
||||
continue;
|
||||
}
|
||||
$pid = filter_var($row['id'] ?? null, FILTER_VALIDATE_INT);
|
||||
if ($pid === false || $pid <= 0) {
|
||||
continue;
|
||||
}
|
||||
$rn = filter_var($row['result_number'] ?? null, FILTER_VALIDATE_INT);
|
||||
$resultNumberByPeriodId[$pid] = ($rn === false ? null : $rn);
|
||||
}
|
||||
}
|
||||
|
||||
$rows = [];
|
||||
foreach ($paginate->items() as $item) {
|
||||
$periodIdValue = filter_var($item->period_id ?? null, FILTER_VALIDATE_INT);
|
||||
if ($periodIdValue === false) {
|
||||
$periodIdValue = 0;
|
||||
}
|
||||
$rows[] = [
|
||||
'order_no' => (string) $item->id,
|
||||
'period_no' => $item->period_no,
|
||||
@@ -410,7 +442,7 @@ class Game extends MobileBase
|
||||
// 整笔压注金额(本笔总扣款)
|
||||
'bet_amount' => $item->total_amount,
|
||||
'total_amount' => $item->total_amount,
|
||||
'result_number' => null,
|
||||
'result_number' => $periodIdValue > 0 ? ($resultNumberByPeriodId[$periodIdValue] ?? null) : null,
|
||||
'win_amount' => $item->win_amount,
|
||||
'status' => (string) $item->status,
|
||||
'create_time' => $item->create_time,
|
||||
|
||||
Reference in New Issue
Block a user