// ...
$this->categories = $this->getCategory();
// ...
public function getFullTree($parentId) {
if (!isset($this->categories[$parentId])) {
return [];
}
$tree = [];
foreach($this->categories[$parentId] as $category) {
$tree[$category->id] = [
'name' => $category->name,
'children' => $this->getFullTree($category->id),
];
}
return $tree;
}
// ...
$tree = $this->getFullTree(0);
На локалке все норм отрабатывало
GRANT SELECT ON mydb.mytbl1 TO 'someuser'@'somehost';
GRANT ALL ON mydb.mytbl2 TO 'someuser'@'somehost';
GRANT ALL ON mydb.mytbl3 TO 'someuser'@'somehost';
GRANT ALL ON mydb.mytbl4 TO 'someuser'@'somehost';
MyActiveRecord::findAll(new Expression('DATE(time) = :current_date', [':current_date' => date('Y-m-d')]));
header('Location: /index.php');