|
@@ -300,3 +300,10 @@ func (m *BaseFromRadishResearchClassify) UpdateLevelPath(classifyId int, levelPa
|
|
|
err = global.DbMap[utils.DbNameIndex].Exec(sql, levelPath, classifyId).Error
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetRadishResearchClassifyByParentIdAndName 根据父级ID和名称获取分类
|
|
|
+func GetRadishResearchClassifyByParentIdAndName(parentId int, classifyName string, classifyId int) (item *EdbClassify, err error) {
|
|
|
+ sql := `SELECT * FROM base_from_radish_research_classify WHERE parent_id = ? AND classify_name = ? AND base_from_radish_research_classify_id <> ? LIMIT 1`
|
|
|
+ err = global.DbMap[utils.DbNameIndex].Raw(sql, parentId, classifyName, classifyId).First(&item).Error
|
|
|
+ return
|
|
|
+}
|