changed categories order and added title unique on tradings
This commit is contained in:
parent
1fba5813ed
commit
ad2d92ee2d
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,5 @@
|
|||
/*!
|
||||
* vue-infinite-loading v2.4.5
|
||||
* (c) 2016-2020 PeachScript
|
||||
* MIT License
|
||||
*/
|
||||
Loading…
Reference in New Issue