修复角色编辑问题

This commit is contained in:
郝大全
2019-02-28 22:49:07 +08:00
parent 5435cf7d58
commit bad2542904
3 changed files with 7 additions and 8 deletions

View File

@@ -15,11 +15,11 @@ notify.type = 0
# 数据库配置
db.host = db
db.user = gotest
db.password = "gotest"
db.host = 127.0.0.1
db.user = root
db.password = "123456"
db.port = 3306
db.name = local_gotest
db.name = ppgo_job2
db.prefix = pp_
db.timezone = Asia/Shanghai

View File

@@ -12,8 +12,6 @@ import (
"strings"
"time"
"fmt"
"github.com/astaxie/beego"
"github.com/george518/PPGo_Job/models"
)
@@ -89,7 +87,6 @@ func (self *RoleController) AjaxSave() {
role.UpdateTime = time.Now().Unix()
role.Status = 1
fmt.Println("=========", role)
auths := strings.TrimSpace(self.GetString("nodes_data"))
role_id, _ := self.GetInt("id")
if role_id == 0 {

View File

@@ -43,7 +43,9 @@ func RoleAuthGetById(id int) ([]*RoleAuth, error) {
}
func RoleAuthDelete(id int) (int64, error) {
return orm.NewOrm().Delete(&RoleAuth{RoleId: int64(id)})
_, err := orm.NewOrm().Raw("DELETE FROM `pp_uc_role_auth` WHERE `role_id` = ?",
strconv.Itoa(id)).Exec()
return 0, err
}
//获取多个