|
@@ -95,14 +95,15 @@ func (b *base_ent_empower) Empower(appid, function_code string, ent_id int64, en
|
|
|
}
|
|
|
b.CancelEmpower(appid, function_code, ent_id, ent_user_id)
|
|
|
r1, _ := Mysql_BaseService.InsertBatch("base_ent_empower", fields, values)
|
|
|
- return r1 == int64(len(functionCodes))*int64(len(ent_user_id))
|
|
|
+ return r1 == int64(len(functionCodes)*len(ent_user_id))
|
|
|
}
|
|
|
|
|
|
//取消授权
|
|
|
func (b *base_ent_empower) CancelEmpower(appid, function_code string, ent_id int64, ent_user_id []int64) bool {
|
|
|
args := []interface{}{appid, ent_id}
|
|
|
wh1 := []string{}
|
|
|
- for _, v := range strings.Split(function_code, ",") {
|
|
|
+ functionCodes := strings.Split(function_code, ",")
|
|
|
+ for _, v := range functionCodes {
|
|
|
wh1 = append(wh1, "?")
|
|
|
args = append(args, v)
|
|
|
}
|
|
@@ -112,5 +113,5 @@ func (b *base_ent_empower) CancelEmpower(appid, function_code string, ent_id int
|
|
|
args = append(args, v)
|
|
|
}
|
|
|
r1 := Mysql_BaseService.UpdateOrDeleteBySql(`delete from base_ent_empower where appid=? and ent_id=? and function_code in (`+strings.Join(wh1, ",")+`) and ent_user_id in (`+strings.Join(wh2, ",")+`)`, args...)
|
|
|
- return r1 == int64(len(ent_user_id))
|
|
|
+ return r1 == int64(len(functionCodes)*len(ent_user_id))
|
|
|
}
|