|
|
@@ -34,7 +34,7 @@ class Bet extends Controller
|
|
|
$limit = request()->input('limit', 10);
|
|
|
|
|
|
$query = BetModel::where(BetService::getWhere($params))
|
|
|
- ->with(['user','issue']);
|
|
|
+ ->with(['user', 'issue']);
|
|
|
|
|
|
|
|
|
if (isset($params['username']) && !empty($params['username'])) {
|
|
|
@@ -52,6 +52,12 @@ class Bet extends Controller
|
|
|
$result = ['total' => $count, 'data' => $list];
|
|
|
foreach ($result['data'] as &$item) {
|
|
|
$item['is_winner'] = null;
|
|
|
+ $winning_array = $item['issue']['winning_array'];
|
|
|
+ unset($item['issue']);
|
|
|
+ $item['issue'] = [
|
|
|
+ 'winning_array' => $winning_array
|
|
|
+ ];
|
|
|
+
|
|
|
if ($item['status'] == 2) {
|
|
|
$item['is_winner'] = $item['profit'] > 0;
|
|
|
}
|