where('status', 0) ->orderBy('sort', 'asc') ->get(['id', 'url', 'to_path', 'sort']); } /** * 分类列表,pid=0 为一级 * 按 sort 升序,同值按 id(需已执行 05_cc_category_add_sort.sql) */ public function categoryList(int $pid = 0): mixed { return CategoryModel::where('pid', $pid) ->where('deleted_at', 0) ->orderBy('sort', 'asc') ->orderBy('id', 'asc') ->get(); } }