/** * 根据 category_id 维护sub_ids字段数据 * @param $category_id int * @return string */ public function get_sub_ids_by_category_id($category_id) { $result = array(); $category = $this->get($category_id); $categories = $this->load(); $result = tree::get_childs($categories, $category_id); $str = implode(',', $result); return $str; }