Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $category = Category::select("oc_category_path.category_id AS id" , DB::raw("GROUP_CONCAT(oc_category_description.name ORDER BY oc_category_path.level SEPARATOR ' > ' AS 'text') "))
  2. ->from("oc_category_path cp")
  3. ->leftJoin("oc_category c", "cp.path_id", "=", "c.category_id")
  4. ->leftJoin("oc_category_description cd1", "c.category_id", "=", "cd1.category_id")
  5. ->leftJoin("oc_category_description cd2 ","cp.category_id","=" ,"cd2.category_id")
  6. ->where("cd1.language_id = 1","cd2.language_id = 1")
  7. ->groupBy("cp.category_id")
  8. ->orderBy("text")
  9. ->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement