|
|
@ -89,10 +89,23 @@ class Recovery extends Controller |
|
|
|
$data['list'] = $list->items(); |
|
|
|
$data['list'] = $list->items(); |
|
|
|
$data['total'] = $list->total(); |
|
|
|
$data['total'] = $list->total(); |
|
|
|
if ($data['total']) { |
|
|
|
if ($data['total']) { |
|
|
|
|
|
|
|
$recovery_id = array_column($data['list'], 'recovery_id'); |
|
|
|
|
|
|
|
$model = new ServerRecovery(); |
|
|
|
|
|
|
|
$recovery_list = $model->whereIn('recovery_id', $recovery_id) |
|
|
|
|
|
|
|
->with(['image']) |
|
|
|
|
|
|
|
->select() |
|
|
|
|
|
|
|
->toArray(); |
|
|
|
|
|
|
|
$image_list = []; |
|
|
|
|
|
|
|
if ($recovery_list) { |
|
|
|
|
|
|
|
$image_list = array_column($recovery_list, 'recovery_image', 'recovery_id'); |
|
|
|
|
|
|
|
} |
|
|
|
foreach ($data['list'] as $key => $value) { |
|
|
|
foreach ($data['list'] as $key => $value) { |
|
|
|
$data['list'][$key]['is_cancel'] = 0; |
|
|
|
$data['list'][$key]['is_cancel'] = 0; |
|
|
|
|
|
|
|
$data['list'][$key]['is_success'] = 0; |
|
|
|
|
|
|
|
$data['list'][$key]['recovery_image'] = !empty($image_list[$value['recovery_id']]) ?: ''; |
|
|
|
if ($value['order_status'] == RecoveryStatusEnum::ACCEPTED) { |
|
|
|
if ($value['order_status'] == RecoveryStatusEnum::ACCEPTED) { |
|
|
|
$data['list'][$key]['is_cancel'] = 1; |
|
|
|
$data['list'][$key]['is_cancel'] = 1; |
|
|
|
|
|
|
|
$data['list'][$key]['is_success'] = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|