获取同级分类 @param id 当前同级分类的id @return cates 分类列表数据
(id interface{})
| 64 | //@param id 当前同级分类的id |
| 65 | //@return cates 分类列表数据 |
| 66 | func (this *Category) GetSameLevelCategoryById(id interface{}) (cates []Category) { |
| 67 | cate := Category{Id: helper.Interface2Int(id)} |
| 68 | o := orm.NewOrm() |
| 69 | o.Read(&cate) |
| 70 | o.QueryTable(GetTableCategory()).Filter("Pid", cate.Pid).All(&cates) |
| 71 | return |
| 72 | } |
| 73 | |
| 74 | // 根据父级id获取分类 |
| 75 | func (this *Category) GetByPid(pid int, status ...bool) (categories []Category) { |
no test coverage detected