|
|
@@ -29,6 +29,12 @@ class Bet extends Controller
|
|
|
'is_winner' => ['nullable', 'integer', 'in:0,1'],
|
|
|
]);
|
|
|
$result = BetService::paginate($params);
|
|
|
+ foreach ($result['data'] as &$item) {
|
|
|
+ $item['is_winner'] = null;
|
|
|
+ if ($item['status'] == 2) {
|
|
|
+ $item['is_winner'] = $item['profit'] > 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::VALIDATION_FAILED, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|