Repair dictionary data judgment

Repair dictionary data judgment
This commit is contained in:
wenjianzhang authored and GitHub committed 2020-05-19 15:00:18 +08:00
commit 618bda0eb0
1 file changed
+1 -1
+1 -1
View File
@@ -33,7 +33,7 @@ func (e *DictData) Create() (DictData, error) {
var doc DictData
i := 0
orm.Eloquent.Table(e.TableName()).Where("dict_label=? or dict_value = ?", e.DictLabel, e.DictValue).Count(&i)
orm.Eloquent.Table(e.TableName()).Where("dict_label=? or (dict_label=? and dict_value = ?)", e.DictLabel, e.DictValue).Count(&i)
if i > 0 {
return doc, errors.New("字典标签或者字典键值已经存在!")
}