Skip to content

Commit

Permalink
fix bug order
Browse files Browse the repository at this point in the history
  • Loading branch information
gtraxx committed Mar 21, 2024
1 parent 203ad5c commit c8884d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 3 additions & 4 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ public function order(){
'type' => 'order'
),
array(
'id_ms' => $p[$i],
'order_ms' => $i
'id_hs' => $p[$i],
'order_hs' => $i
)
);
}
Expand Down Expand Up @@ -267,8 +267,7 @@ public function run()
break;
case 'get':
if(isset($this->content)) {
$defaultLanguage = $this->collectionLanguage->fetchData(array('context'=>'one','type'=>'default'));
$this->setPagesTree($this->getItems($this->content,array('default_lang' => $defaultLanguage['id_lang']),'all',false));
$this->setPagesTree($this->getItems($this->content,null,'all',false));
$this->template->display('loop/page.tpl');
}
break;
Expand Down
13 changes: 8 additions & 5 deletions db.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ public function fetchData(array $config, array $params = []) {
ORDER BY hs.order_hs ASC";
break;
case 'pages':
$query = 'SELECT mcp.id_pages AS id, mcp.id_parent AS parent, mcpc.name_pages AS name
FROM mc_cms_page AS mcp
LEFT JOIN mc_cms_page_content AS mcpc USING ( id_pages )
LEFT JOIN mc_lang as ml ON (mcpc.id_lang = ml.id_lang)
WHERE ml.id_lang = :default_lang AND mcp.menu_pages = 1
$query = 'SELECT
mcp.id_pages AS id,
mcp.id_parent AS parent,
mcpc.name_pages AS name
FROM mc_cms_page AS mcp
LEFT JOIN mc_cms_page_content AS mcpc USING ( id_pages )
LEFT JOIN mc_lang AS ml ON (mcpc.id_lang = ml.id_lang AND ml.default_lang = 1)
WHERE mcp.menu_pages = 1
AND mcpc.published_pages = 1
ORDER BY mcp.id_pages';
break;
Expand Down

0 comments on commit c8884d6

Please sign in to comment.