Sort compatible battery list by highest price #24
This commit is contained in:
parent
cae5a5bbac
commit
d77dbcd209
1 changed files with 6 additions and 1 deletions
|
|
@ -303,6 +303,11 @@ class BatteryManufacturerController extends BaseController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// order by price
|
||||||
|
usort($batteries, function ($a, $b) {
|
||||||
|
return -($a['sell_price'] <=> $b['sell_price']);
|
||||||
|
});
|
||||||
|
|
||||||
// response
|
// response
|
||||||
return $this->json([
|
return $this->json([
|
||||||
'data' => $batteries
|
'data' => $batteries
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue