|
@@ -35,9 +35,9 @@ class PageService extends BaseService
|
|
|
public function categoryTree($source = "")
|
|
|
{
|
|
|
if ($source == "home") {
|
|
|
- $categoryS = Category::with("childS")->where("parent_id", 0)->where("index_weight", ">", 0)->orderByDesc("category_weight")->get(["id", "name", "thumb", "parent_id", "level", "weight"]);
|
|
|
- } else {
|
|
|
$categoryS = Category::with("childS")->where("parent_id", 0)->where("index_weight", ">", 0)->orderByDesc("index_weight")->get(["id", "name", "thumb", "parent_id", "level", "weight"]);
|
|
|
+ } else {
|
|
|
+ $categoryS = Category::with("childS")->where("parent_id", 0)->where("index_weight", ">", 0)->orderByDesc("category_weight")->get(["id", "name", "thumb", "parent_id", "level", "weight"]);
|
|
|
}
|
|
|
|
|
|
return $categoryS->map(function (Category $category) {
|