changed categories order and added title unique on tradings

This commit is contained in:
Amanmyrat 2022-12-14 21:52:21 +05:00
parent 1fba5813ed
commit ad2d92ee2d
4 changed files with 10 additions and 4 deletions

View File

@ -10,7 +10,7 @@ class CategoryController extends ApiController
{
public function index()
{
$categories = Category::orderBy('lft', 'desc')->get();
$categories = Category::orderBy('lft', 'asc')->get();
return $this->respondWithCollection($categories, new CategoryTransformer($this->locale, 'trading'));
}
}

View File

@ -12,9 +12,7 @@ class TradingsController extends ApiController
public function index()
{
$last_tradings = Group::where("type", "trading")->with("tradings")->latest()->first()->tradings;
// foreach($last_tradings as $trading){
// $trading->title = trim(strtok($trading->title, '('));
// }
$last_tradings = $last_tradings->unique('title');
$tradings = [];
@ -34,6 +32,7 @@ class TradingsController extends ApiController
}
$tradings = Trading::hydrate($tradings);
$tradings = $tradings->unique('title');
return $this->respondWithCollection($tradings, new TradingTransformer);
}

2
public/js/495.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
/*!
* vue-infinite-loading v2.4.5
* (c) 2016-2020 PeachScript
* MIT License
*/