0) { $currentFirstId = Category::firstGradeById($categoryId); } //δΊ§ε“θœε• $product_children=Category::alias('c') ->leftJoin('model m', 'c.model_id=m.id') ->field('c.*, m.manager, m.template, m.name as modelName') ->where('c.parent_id', 5) ->order('c.sort','asc') ->select() ->toArray(); $data = [ 'categoryId' => $categoryId, 'menus' => $menus, 'product_children' => $product_children?$product_children:[], ]; $this_menu= \app\model\Category::alias('c') ->leftJoin('model m', 'c.model_id=m.id') ->field('c.*, m.manager, m.name as modelName') ->when(3, function($query) { $query->whereIn('c.id', []); }) ->order('sort','asc') ->select() ->toArray(); return View::assign($data)->fetch('public/menu'); } }