Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev
This commit is contained in:
commit
918e5c2ce1
1 file changed
+4
-1
@@ -35,7 +35,10 @@ func (e *DictData) Create() (DictData, error) {
|
||||
var doc DictData
|
||||
|
||||
var i int64
|
||||
if err := orm.Eloquent.Table(e.TableName()).Where("dict_label=? or (dict_label=? and dict_value = ?)", e.DictLabel, e.DictLabel, e.DictValue).Count(&i).Error; err != nil {
|
||||
if err := orm.Eloquent.Table(e.TableName()).
|
||||
Where("dict_type = ?", e.DictType).
|
||||
Where("dict_label=? or (dict_label=? and dict_value = ?)", e.DictLabel, e.DictLabel, e.DictValue).
|
||||
Count(&i).Error; err != nil {
|
||||
return doc, err
|
||||
}
|
||||
if i > 0 {
|
||||
|
||||
Reference in new issue
Block a user