fix bug.
This commit is contained in:
parent
8231711e3b
commit
4a39a38255
@ -32,6 +32,7 @@ func CreateClassify(c *gin.Context) {
|
|||||||
// 判断创建的分类是否存在
|
// 判断创建的分类是否存在
|
||||||
err = orm.Eloquent.Table("p_process_classify").
|
err = orm.Eloquent.Table("p_process_classify").
|
||||||
Where("name = ?", classifyValue.Name).
|
Where("name = ?", classifyValue.Name).
|
||||||
|
Where("`delete_time` IS NULL").
|
||||||
Count(&classifyCount).Error
|
Count(&classifyCount).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.Error(c, -1, err, "")
|
app.Error(c, -1, err, "")
|
||||||
|
@ -108,7 +108,7 @@ func (role *SysRole) GetRoleMeunId() ([]int, error) {
|
|||||||
|
|
||||||
func (role *SysRole) Insert() (id int, err error) {
|
func (role *SysRole) Insert() (id int, err error) {
|
||||||
i := 0
|
i := 0
|
||||||
orm.Eloquent.Table("sys_role").Where("role_name=? or role_key = ?", role.RoleName, role.RoleKey).Count(&i)
|
orm.Eloquent.Table("sys_role").Where("(role_name = ? or role_key = ?) and `delete_time` IS NULL", role.RoleName, role.RoleKey).Count(&i)
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
return 0, errors.New("角色名称或者角色标识已经存在!")
|
return 0, errors.New("角色名称或者角色标识已经存在!")
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ func (e SysUser) Insert() (id int, err error) {
|
|||||||
|
|
||||||
// check 用户名
|
// check 用户名
|
||||||
var count int
|
var count int
|
||||||
orm.Eloquent.Table(e.TableName()).Where("username = ?", e.Username).Count(&count)
|
orm.Eloquent.Table(e.TableName()).Where("username = ? and `delete_time` IS NULL", e.Username).Count(&count)
|
||||||
if count > 0 {
|
if count > 0 {
|
||||||
err = errors.New("账户已存在!")
|
err = errors.New("账户已存在!")
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user